summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/src/com/vaadin/client/ui/VTabsheet.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java
index 68a685965b..85c28218f7 100644
--- a/client/src/com/vaadin/client/ui/VTabsheet.java
+++ b/client/src/com/vaadin/client/ui/VTabsheet.java
@@ -1164,12 +1164,9 @@ public class VTabsheet extends VTabsheetBase implements Focusable,
activeTabIndex = newTabIndex;
if (isScrolledTabs()) {
// Scroll until the new active tab is visible
- int newScrollerIndex = scrollerIndex;
- while (tb.getTab(activeTabIndex).getAbsoluteLeft() < getAbsoluteLeft()
- && newScrollerIndex != -1) {
- newScrollerIndex = tb.scrollLeft(newScrollerIndex);
+ while (!tb.getTab(activeTabIndex).isVisible()) {
+ scrollerIndex = tb.scrollLeft(scrollerIndex);
}
- scrollerIndex = newScrollerIndex;
updateTabScroller();
}
}