summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@gmail.com>2017-03-10 13:08:36 +0200
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-03-16 16:21:24 +0200
commitba46c521e3986bf42a247e8f7ad870d1c7cbb17d (patch)
treeef14fe14082b0fc245d97d53d060eceb6afc1b03 /client
parentf29de26c03fae5c174c9383d7f322bff52e5a802 (diff)
downloadvaadin-framework-ba46c521e3986bf42a247e8f7ad870d1c7cbb17d.tar.gz
vaadin-framework-ba46c521e3986bf42a247e8f7ad870d1c7cbb17d.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.java18
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?
*