summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VTabsheet.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java
index 1ea41f634d..9b1608cb65 100644
--- a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java
+++ b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java
@@ -556,9 +556,14 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware
newSelected.recalculateCaptionWidth();
getTab(tabsheet.activeTabIndex).recalculateCaptionWidth();
- // Scroll the tab into view if it is not already
- getTabsheet().scrollIntoView(getTab(tabsheet.activeTabIndex));
-
+ // Scroll the tab into view if it is not already, after layout
+ Scheduler.get().scheduleFinally(new Scheduler.ScheduledCommand() {
+ @Override
+ public void execute() {
+ getTabsheet()
+ .scrollIntoView(getTab(tabsheet.activeTabIndex));
+ }
+ });
}
public Tab navigateTab(int fromIndex, int toIndex) {