summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2019-04-03 14:32:35 +0300
committerOlli Tietäväinen <ollit@vaadin.com>2019-04-03 14:32:35 +0300
commitf24723c1dbd9635d6bc54fd1f0ba69f26e647438 (patch)
tree3ebcaa719126575700d7d6174046be8a11246963
parentdf19d2a4a5e5e44b0231fd4bc1119ad11f1c71ac (diff)
downloadvaadin-framework-f24723c1dbd9635d6bc54fd1f0ba69f26e647438.tar.gz
vaadin-framework-f24723c1dbd9635d6bc54fd1f0ba69f26e647438.zip
Change VSlider to use Event.ONKEYDOWN with Firefox 65+ (#11506)7.7.18
Fixes #11502
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VSlider.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VSlider.java b/client/src/main/java/com/vaadin/client/ui/VSlider.java
index 9a572b95c3..b6418f8d55 100644
--- a/client/src/main/java/com/vaadin/client/ui/VSlider.java
+++ b/client/src/main/java/com/vaadin/client/ui/VSlider.java
@@ -283,11 +283,7 @@ public class VSlider extends SimpleFocusablePanel
increaseValue(true);
} else if (DOM.eventGetType(event) == Event.MOUSEEVENTS) {
processBaseEvent(event);
- } else if (BrowserInfo.get().isGecko()
- && DOM.eventGetType(event) == Event.ONKEYPRESS
- || !BrowserInfo.get().isGecko()
- && DOM.eventGetType(event) == Event.ONKEYDOWN) {
-
+ } else if (isNavigationEvent(event)) {
if (handleNavigation(event.getKeyCode(), event.getCtrlKey(),
event.getShiftKey())) {
@@ -313,6 +309,14 @@ public class VSlider extends SimpleFocusablePanel
}
}
+ private boolean isNavigationEvent(Event event) {
+ if (BrowserInfo.get().isGecko() && BrowserInfo.get().getGeckoVersion() < 65) {
+ return DOM.eventGetType(event) == Event.ONKEYPRESS;
+ } else {
+ return DOM.eventGetType(event) == Event.ONKEYDOWN;
+ }
+ }
+
private void processMouseWheelEvent(final Event event) {
final int dir = DOM.eventGetMouseWheelVelocityY(event);