summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);