summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VScrollTable.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java
index c76dd38d8f..6f9fd6da88 100644
--- a/client/src/com/vaadin/client/ui/VScrollTable.java
+++ b/client/src/com/vaadin/client/ui/VScrollTable.java
@@ -1098,6 +1098,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
}
}
+ private ScheduledCommand lazyScroller = new ScheduledCommand() {
+ @Override
+ public void execute() {
+ int offsetTop = measureRowHeightOffset(firstvisible);
+ scrollBodyPanel.setScrollPosition(offsetTop);
+ }
+ };
+
/** For internal use only. May be removed or replaced in the future. */
public void updateFirstVisibleAndScrollIfNeeded(UIDL uidl) {
firstvisible = uidl.hasVariable("firstvisible") ? uidl
@@ -1105,8 +1113,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
if (firstvisible != lastRequestedFirstvisible && scrollBody != null) {
// received 'surprising' firstvisible from server: scroll there
firstRowInViewPort = firstvisible;
- scrollBodyPanel
- .setScrollPosition(measureRowHeightOffset(firstvisible));
+
+ /*
+ * Schedule the scrolling to be executed last so no updates to the rows
+ * affect scrolling measurements.
+ */
+ Scheduler.get().scheduleFinally(lazyScroller);
}
}