Browse Source

Merge branch '7.7' into fix11502

fix11502
Olli Tietäväinen 5 years ago
parent
commit
b2b507e94c
No account linked to committer's email address

+ 2
- 2
client/src/main/java/com/vaadin/client/ui/VCalendarPanel.java View File

@@ -211,11 +211,11 @@ public class VCalendarPanel extends FocusableFlexTable implements
Roles.getGridRole().set(getElement());

/*
* 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 (BrowserInfo.get().isGecko() && BrowserInfo.get().getGeckoVersion() < 65) {
addKeyPressHandler(this);
} else {
addKeyDownHandler(this);

+ 10
- 6
client/src/main/java/com/vaadin/client/ui/VScrollTable.java View File

@@ -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);

+ 2
- 2
client/src/main/java/com/vaadin/client/ui/VTree.java View File

@@ -209,11 +209,11 @@ public class VTree extends FocusElementPanel
}, ContextMenuEvent.getType());

/*
* 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 (BrowserInfo.get().isGecko() && BrowserInfo.get().getGeckoVersion() < 65) {
addKeyPressHandler(this);
} else {
addKeyDownHandler(this);

Loading…
Cancel
Save