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();