diff options
author | adam <adam@vaadin.com> | 2016-07-18 16:21:52 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-08-03 09:57:31 +0000 |
commit | 35078caabebfda612867c68b38f1d554dd3192a7 (patch) | |
tree | 60940ee452272b9936ed3b843edefe1f9b30855e /client/src | |
parent | c7ce7a129720490c31e466d62f725f9d866e0753 (diff) | |
download | vaadin-framework-35078caabebfda612867c68b38f1d554dd3192a7.tar.gz vaadin-framework-35078caabebfda612867c68b38f1d554dd3192a7.zip |
Fixing TabSheet scrolling within SplitPanel (#20052)
This patch fixes an issue with disappearing tabs in a TabSheet placed in a
SplitPanel.
Scrolling a tab into view needs to be done after layout has happened. Otherwise
the available width for TabSheet is unknown and causes unexpected behaviour.
Change-Id: Ibcea04ddadfafc5028efe44a6817517b16e21bde
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VTabsheet.java | 11 |
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) { |