From: Anna Koskinen Date: Tue, 20 Oct 2020 10:54:42 +0000 (+0300) Subject: When a Grid gets scroll-locked, cancel the scrollInProgress handler. (#12116) (#12127) X-Git-Tag: 8.12.0~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c490883da61d317cdf1364da5c313c3ca63edcea;p=vaadin-framework.git When a Grid gets scroll-locked, cancel the scrollInProgress handler. (#12116) (#12127) 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. --- 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; + } } }