summaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2019-10-29 12:59:27 +0200
committerOlli Tietäväinen <ollit@vaadin.com>2019-10-29 12:59:27 +0200
commit643c29cfdb2c5c50b3b6ddd29ac90761d1e777c1 (patch)
tree54ff9c37c62e56f1a625c73e37310ae5aab88ab5 /client/src
parent1167c3bc4eef39d904dc804b231d75e5326e5879 (diff)
downloadvaadin-framework-643c29cfdb2c5c50b3b6ddd29ac90761d1e777c1.tar.gz
vaadin-framework-643c29cfdb2c5c50b3b6ddd29ac90761d1e777c1.zip
Added 1px tolerance to ScrollbarBundle's internal sanity check. (#11777)
* Added 1px tolerance to ScrollbarBundle's internal sanity check. Requiring exact match can cause this check to fail when the browser is zoomed since rounding is involved. This can in turn block some features like opening of Grid Editor from working until some more scrolling happens and the minute inconsistency is fixed. Can be tested manually using GridEditorUI, depending on the environment different amounts of zooming may be required for the problem to manifest. Fixes #11672
Diffstat (limited to 'client/src')
-rw-r--r--client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java8
1 files changed, 5 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 d0ae71e4d4..8042e1b264 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
@@ -587,10 +587,12 @@ public abstract class ScrollbarBundle implements DeferredWorker {
* @return the new scroll position in pixels
*/
public final double getScrollPos() {
- assert internalGetScrollPos() == toInt32(
- scrollPos) : "calculated scroll position (" + scrollPos
+ int internalScrollPos = internalGetScrollPos();
+ assert Math.abs(internalScrollPos
+ - toInt32(scrollPos)) <= 1 : "calculated scroll position ("
+ + scrollPos
+ ") did not match the DOM element scroll position ("
- + internalGetScrollPos() + ")";
+ + internalScrollPos + ")";
return scrollPos;
}