]> source.dussan.org Git - vaadin-framework.git/commitdiff
Change VSlider to use Event.ONKEYDOWN with Firefox 65+ (#11506) 7.7.18
authorTatu Lund <tatu@vaadin.com>
Wed, 3 Apr 2019 11:32:35 +0000 (14:32 +0300)
committerOlli Tietäväinen <ollit@vaadin.com>
Wed, 3 Apr 2019 11:32:35 +0000 (14:32 +0300)
Fixes #11502

client/src/main/java/com/vaadin/client/ui/VSlider.java

index 9a572b95c3e5accaac61285b36ded311acdcdec8..b6418f8d556ebbd7bf119751ce715e09c69890ee 100644 (file)
@@ -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);