From: Jonatan Kronqvist Date: Tue, 4 Feb 2014 10:51:12 +0000 (+0200) Subject: Merge commit 'b7e184e30f8e5f1456344f3360c7e8e326c5ad2b' into master X-Git-Tag: 7.2.0.beta1~190^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dca994edd2e9803fa75d518e07b00194e607a6fc;p=vaadin-framework.git Merge commit 'b7e184e30f8e5f1456344f3360c7e8e326c5ad2b' into master Original commit message: Cleaned up the implementation of VTabsheet.selectPreviousTab() Conflicts: client/src/com/vaadin/client/ui/VTabsheet.java Change-Id: I8798c2f8e5d5922aa4e7d1b9ce2617eaa1c4ab03 --- dca994edd2e9803fa75d518e07b00194e607a6fc diff --cc client/src/com/vaadin/client/ui/VTabsheet.java index c8b084778f,85c28218f7..ceeb3b565a --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@@ -1281,27 -1158,15 +1281,24 @@@ public class VTabsheet extends VTabshee // Find the previous visible and enabled tab if any. do { newTabIndex--; - } while (newTabIndex >= 0 && !onTabSelected(newTabIndex)); + } while (newTabIndex >= 0 && !canSelectTab(newTabIndex)); if (newTabIndex >= 0) { - activeTabIndex = newTabIndex; + 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 - int newScrollerIndex = scrollerIndex; - while (tb.getTab(focusedTabIndex).getAbsoluteLeft() < getAbsoluteLeft() - && newScrollerIndex != -1) { - newScrollerIndex = tb.scrollLeft(newScrollerIndex); + while (!tb.getTab(activeTabIndex).isVisible()) { + scrollerIndex = tb.scrollLeft(scrollerIndex); } - scrollerIndex = newScrollerIndex; updateTabScroller(); } }