diff options
author | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-03-28 14:12:09 +0200 |
---|---|---|
committer | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-03-28 14:12:55 +0200 |
commit | 9d253245e848440955ab608004900c296d74c833 (patch) | |
tree | ade6968a2e3be2e1ae704042383772e8843a860f /client | |
parent | 9e98c0cb230a26b2f73cb612183c34f2e779645b (diff) | |
parent | d5ce54586a445550b3df5168fe83accb3945901e (diff) | |
download | vaadin-framework-9d253245e848440955ab608004900c296d74c833.tar.gz vaadin-framework-9d253245e848440955ab608004900c296d74c833.zip |
Merge commit 'd5ce54586a445550b3df5168fe83accb3945901e' into master
d5ce545 Ignore backspace events in modal windows (#13180)
Conflicts:
client/src/com/vaadin/client/ui/VWindow.java
Change-Id: I22c38a281fac7ed7cfa40f292e6624c5347348fd
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VWindow.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index c88634b847..d6dd9c7b1d 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -176,6 +176,8 @@ public class VWindow extends VWindowOverlay implements // Prevents leaving the window with the Tab key when true private boolean doTabStop; + private boolean hasFocus; + /** * If centered (via UIDL), the window should stay in the centered -mode * until a position is received from the server, or the user moves or @@ -1298,6 +1300,10 @@ public class VWindow extends VWindowOverlay implements @Override public void onKeyDown(KeyDownEvent event) { + if (hasFocus && event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE) { + event.preventDefault(); + } + if (shortcutHandler != null) { shortcutHandler .handleKeyboardEvent(Event.as(event.getNativeEvent())); @@ -1314,6 +1320,8 @@ public class VWindow extends VWindowOverlay implements @Override public void onBlur(BlurEvent event) { + hasFocus = false; + if (client.hasEventListeners(this, EventId.BLUR)) { client.updateVariable(id, EventId.BLUR, "", true); } @@ -1321,6 +1329,8 @@ public class VWindow extends VWindowOverlay implements @Override public void onFocus(FocusEvent event) { + hasFocus = true; + if (client.hasEventListeners(this, EventId.FOCUS)) { client.updateVariable(id, EventId.FOCUS, "", true); } |