From b817d61d6ab3f22057a85018a68701cb9ed5473f Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Mon, 12 Oct 2020 14:42:40 +0300 Subject: [PATCH] When a Grid gets scroll-locked, cancel the scrollInProgress handler. (#12116) 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/widget/escalator/ScrollbarBundle.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java b/client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java index 8042e1b264..122c302f36 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java @@ -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; + } } } -- 2.39.5