]> source.dussan.org Git - vaadin-framework.git/commitdiff
When a Grid gets scroll-locked, cancel the scrollInProgress handler. (#12116)
authorAnna Koskinen <Ansku@users.noreply.github.com>
Mon, 12 Oct 2020 11:42:40 +0000 (14:42 +0300)
committerGitHub <noreply@github.com>
Mon, 12 Oct 2020 11:42:40 +0000 (14:42 +0300)
Otherwise opening a Grid editor can cause ApplicationConnection to get
stuck in 'active' state even if no actual scroll position processing is
ongoing, which in turn causes TestBench delays when it tries to wait
until ApplicationConnection indicates that everything necessary has been
processed.

client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java

index 8042e1b264a16d88211a0b5f56b4830379d446fa..122c302f362f8599a50433f620a39f73a80fa0da 100644 (file)
@@ -790,9 +790,16 @@ public abstract class ScrollbarBundle implements DeferredWorker {
         if (!isLocked()) {
             scrollPos = newScrollPos;
             scrollEventFirer.scheduleEvent();
-        } else if (scrollPos != newScrollPos) {
-            // we need to actually undo the setting of the scroll.
-            internalSetScrollPos(toInt32(scrollPos));
+        } else {
+            if (scrollPos != newScrollPos) {
+                // we need to actually undo the setting of the scroll.
+                internalSetScrollPos(toInt32(scrollPos));
+            }
+            if (scrollInProgress != null) {
+                // cancel the in-progress indicator
+                scrollInProgress.removeHandler();
+                scrollInProgress = null;
+            }
         }
     }