]> source.dussan.org Git - vaadin-framework.git/commitdiff
Prevent Escalator scrollbars oscillation in HeightByRows mode (#18596)
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Fri, 14 Aug 2015 10:21:53 +0000 (13:21 +0300)
committerVaadin Code Review <review@vaadin.com>
Fri, 14 Aug 2015 10:59:11 +0000 (10:59 +0000)
Change-Id: Id7e72fbd31277b7c93055c8aa9309d73c86795d6

client/src/com/vaadin/client/widgets/Escalator.java

index 99f13378d4d3389f2aa53f73857209ae935bd0b9..5b3d4e1b705419fedded3e6c2a774a7ecc27f3e5 100644 (file)
@@ -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;
+                            }
+                        });
                     }
                 });