From: Juho Nurminen Date: Thu, 6 Feb 2014 13:54:59 +0000 (+0200) Subject: Merge commit '9ab700417ee5fe54329beee3130e6303f9420389' into master X-Git-Tag: 7.2.0.beta1~189 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b0146f3a91a4d993eed662b1b4c02de9d34f6bd2;p=vaadin-framework.git Merge commit '9ab700417ee5fe54329beee3130e6303f9420389' into master * commit '9ab700417ee5fe54329beee3130e6303f9420389': Fixed TabSheet tab keyboard focus issues (#12343) Conflicts: client/src/com/vaadin/client/ui/VTabsheet.java Change-Id: Id80bad07d004149c017ccee79994b4fbdfa71299 --- b0146f3a91a4d993eed662b1b4c02de9d34f6bd2 diff --cc client/src/com/vaadin/client/ui/VTabsheet.java index ceeb3b565a,1275308ed7..cc66642cdd --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@@ -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); @@@ -1281,22 -1164,13 +1288,22 @@@ // 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();