summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2019-03-28 11:50:32 +0200
committerOlli Tietäväinen <ollit@vaadin.com>2019-03-28 11:50:32 +0200
commit423f5e039511677a881d53cf59ab34f39f7bb7db (patch)
treec4aa2d1ed20733a31d86a7692ca9e30352f9dbe8
parent1d68b3009d7186ab843f092eefee891649e9f765 (diff)
downloadvaadin-framework-423f5e039511677a881d53cf59ab34f39f7bb7db.tar.gz
vaadin-framework-423f5e039511677a881d53cf59ab34f39f7bb7db.zip
Change VMenuBar to use KeyDownHandler with Firefox 65+ (#11508)
#11502
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VScrollTable.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VScrollTable.java b/client/src/main/java/com/vaadin/client/ui/VScrollTable.java
index e1cb595928..3659bf6bb7 100644
--- a/client/src/main/java/com/vaadin/client/ui/VScrollTable.java
+++ b/client/src/main/java/com/vaadin/client/ui/VScrollTable.java
@@ -557,10 +557,10 @@ public class VScrollTable extends FlowPanel
@Override
public void onKeyPress(KeyPressEvent keyPressEvent) {
- // This is used for Firefox only, since Firefox auto-repeat
+ // This is used for Firefox prior to v65 only, since Firefox auto-repeat
// works correctly only if we use a key press handler, other
// browsers handle it correctly when using a key down handler
- if (!BrowserInfo.get().isGecko()) {
+ if (!useOldGeckoNavigation()) {
return;
}
@@ -624,8 +624,8 @@ public class VScrollTable extends FlowPanel
@Override
public void onKeyDown(KeyDownEvent keyDownEvent) {
NativeEvent event = keyDownEvent.getNativeEvent();
- // This is not used for Firefox
- if (BrowserInfo.get().isGecko()) {
+ // This is not used for Firefox prior to v65
+ if (useOldGeckoNavigation()) {
return;
}
@@ -829,11 +829,11 @@ public class VScrollTable extends FlowPanel
scrollBodyPanel.addScrollHandler(this);
/*
- * Firefox auto-repeat works correctly only if we use a key press
+ * Firefox prior to v65 auto-repeat works correctly only if we use a key press
* handler, other browsers handle it correctly when using a key down
* handler
*/
- if (BrowserInfo.get().isGecko()) {
+ if (useOldGeckoNavigation()) {
scrollBodyPanel.addKeyPressHandler(navKeyPressHandler);
} else {
scrollBodyPanel.addKeyDownHandler(navKeyDownHandler);
@@ -856,6 +856,10 @@ public class VScrollTable extends FlowPanel
updateStyleNames(style, false);
}
+ private boolean useOldGeckoNavigation() {
+ return BrowserInfo.get().isGecko() && BrowserInfo.get().getGeckoVersion() < 65;
+ }
+
@Override
public void setStylePrimaryName(String style) {
updateStyleNames(style, true);