]> source.dussan.org Git - vaadin-framework.git/commitdiff
Merge commit '9ab700417ee5fe54329beee3130e6303f9420389' into master
authorJuho Nurminen <juho@vaadin.com>
Thu, 6 Feb 2014 13:54:59 +0000 (15:54 +0200)
committerJuho Nurminen <juho@vaadin.com>
Thu, 6 Feb 2014 14:07:57 +0000 (16:07 +0200)
* commit '9ab700417ee5fe54329beee3130e6303f9420389':
  Fixed TabSheet tab keyboard focus issues (#12343)

Conflicts:
client/src/com/vaadin/client/ui/VTabsheet.java

Change-Id: Id80bad07d004149c017ccee79994b4fbdfa71299

1  2 
client/src/com/vaadin/client/ui/VTabsheet.java

index ceeb3b565a1d575e61fc09869f1eb608ed3924f4,1275308ed72c6cd9decb5a27750d0fd13ab3536d..cc66642cdd4361d939fcb13db81f4dde3f267fd6
@@@ -130,12 -117,8 +130,12 @@@ public class VTabsheet extends VTabshee
              this.tabBar = tabBar;
              setStyleName(td, TD_CLASSNAME);
  
 +            Roles.getTabRole().set(getElement());
 +            Roles.getTabRole().setAriaSelectedState(getElement(),
 +                    SelectedValue.FALSE);
 +
              div = DOM.createDiv();
-             focusImpl.setTabIndex(td, -1);
+             setTabulatorIndex(-1);
              setStyleName(div, DIV_CLASSNAME);
  
              DOM.appendChild(td, div);
          // Find the previous visible and enabled tab if any.
          do {
              newTabIndex--;
 -            newTab = tb.getTab(newTabIndex);
 -        } while (newTabIndex >= 0 && !newTab.isSelectable());
 +        } while (newTabIndex >= 0 && !canSelectTab(newTabIndex));
  
          if (newTabIndex >= 0) {
 +            tb.navigateTab(focusedTabIndex, newTabIndex);
 +            focusedTabIndex = newTabIndex;
 +
 +            // If this TabSheet already has focus, set the new selected tab
 +            // as focused.
 +            if (focusedTab != null) {
 +                focusedTab = tb.getTab(focusedTabIndex);
 +                focusedTab.focus();
 +            }
 +
              if (isScrolledTabs()) {
--                // Scroll until the new active tab is visible
-                 while (!tb.getTab(activeTabIndex).isVisible()) {
 -                while (!newTab.isVisible()) {
++                // Scroll until the new focused tab is visible
++                while (!tb.getTab(focusedTabIndex).isVisible()) {
                      scrollerIndex = tb.scrollLeft(scrollerIndex);
                  }
                  updateTabScroller();