From 322d777d2eaece892a16d4f486f5108740e9226a Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 14 Aug 2015 13:21:53 +0300 Subject: Prevent Escalator scrollbars oscillation in HeightByRows mode (#18596) Change-Id: Ie44ee231d83491af8704f989300a0b8cd9888374 --- client/src/com/vaadin/client/widgets/Escalator.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/client/src/com/vaadin/client/widgets/Escalator.java b/client/src/com/vaadin/client/widgets/Escalator.java index 99f13378d4..5b3d4e1b70 100644 --- a/client/src/com/vaadin/client/widgets/Escalator.java +++ b/client/src/com/vaadin/client/widgets/Escalator.java @@ -5641,14 +5641,29 @@ public class Escalator extends Widget implements RequiresResize, horizontalScrollbar.setScrollbarThickness(scrollbarThickness); horizontalScrollbar .addVisibilityHandler(new ScrollbarBundle.VisibilityHandler() { + + private boolean queued = false; + @Override public void visibilityChanged( ScrollbarBundle.VisibilityChangeEvent event) { + if (queued) { + return; + } + queued = true; + /* * We either lost or gained a scrollbar. In any case, we * need to change the height, if it's defined by rows. */ - applyHeightByRows(); + Scheduler.get().scheduleFinally(new ScheduledCommand() { + + @Override + public void execute() { + applyHeightByRows(); + queued = false; + } + }); } }); -- cgit v1.2.3