diff options
author | Henri Sara <henri.sara@gmail.com> | 2017-03-10 13:08:36 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2017-03-10 13:08:36 +0200 |
commit | dc657b3208f1eaf1b41b3640bd854cc0e2ef47f9 (patch) | |
tree | c210fa5d0efb05bd5779209da6dbf3f24a05801b /client | |
parent | a7eb9f7f704e8dfc098efe1e5115ccddb8367c45 (diff) | |
download | vaadin-framework-dc657b3208f1eaf1b41b3640bd854cc0e2ef47f9.tar.gz vaadin-framework-dc657b3208f1eaf1b41b3640bd854cc0e2ef47f9.zip |
Fix ComboBox popup location on scrolled pages in IE/Firefox
Fixes #8778
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VComboBox.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VComboBox.java b/client/src/main/java/com/vaadin/client/ui/VComboBox.java index d0de766a55..668e88b126 100644 --- a/client/src/main/java/com/vaadin/client/ui/VComboBox.java +++ b/client/src/main/java/com/vaadin/client/ui/VComboBox.java @@ -243,12 +243,12 @@ public class VComboBox extends Composite implements Field, KeyDownHandler, return $entry(function(e) { var deltaX = e.deltaX ? e.deltaX : -0.5*e.wheelDeltaX; var deltaY = e.deltaY ? e.deltaY : -0.5*e.wheelDeltaY; - + // IE8 has only delta y if (isNaN(deltaY)) { deltaY = -0.5*e.wheelDelta; } - + @com.vaadin.client.ui.VComboBox.JsniUtil::moveScrollFromEvent(*)(widget, deltaX, deltaY, e, e.deltaMode); }); }-*/; @@ -410,10 +410,13 @@ public class VComboBox extends Composite implements Field, KeyDownHandler, // Add TT anchor point getElement().setId("VAADIN_COMBOBOX_OPTIONLIST"); - final int x = VComboBox.this.getAbsoluteLeft(); + final int x = toInt32(WidgetUtil + .getBoundingClientRect(VComboBox.this.getElement()) + .getLeft()); - topPosition = tb.getAbsoluteTop(); - topPosition += tb.getOffsetHeight(); + topPosition = toInt32(WidgetUtil + .getBoundingClientRect(tb.getElement()).getBottom()) + + Window.getScrollTop(); setPopupPosition(x, topPosition); @@ -449,6 +452,11 @@ public class VComboBox extends Composite implements Field, KeyDownHandler, setPopupPositionAndShow(popup); } + private native int toInt32(double val) + /*-{ + return val | 0; + }-*/; + /** * Should the next page button be visible to the user? * |