diff options
author | Shawn O. Pearce <sop@google.com> | 2010-08-19 17:04:01 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2010-08-19 17:04:01 -0700 |
commit | 2455901afc79bcc08de16b9e55ee8aa66194b85d (patch) | |
tree | 7a9cee29ea1d6de03bd9009e4c6b4a15db1ae434 | |
parent | 8e046b89368fc5b72826cd74bb538f95a6f884a6 (diff) | |
download | gwtexpui-2455901afc79bcc08de16b9e55ee8aa66194b85d.tar.gz |
Always prevent default event delivery on keysv1.2.2
If we matched a key binding, we want to steal that from the
browser agent and never permit it to use its default action.
Change-Id: I245b99ab0d890573571184f89599718e1be70ce7
Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | src/main/java/com/google/gwtexpui/globalkey/client/KeyCommandSet.java | 1 | ||||
-rw-r--r-- | src/main/java/com/google/gwtexpui/globalkey/client/NpTextArea.java | 5 |
3 files changed, 7 insertions, 1 deletions
@@ -21,7 +21,7 @@ limitations under the License. <groupId>gwtexpui</groupId> <artifactId>gwtexpui</artifactId> <packaging>jar</packaging> - <version>1.2.1</version> + <version>1.2.2</version> <name>gwtexpui</name> <description>Extended UI tools for GWT</description> <url>http://android.git.kernel.org/?p=tools/gwtexpui.git</url> diff --git a/src/main/java/com/google/gwtexpui/globalkey/client/KeyCommandSet.java b/src/main/java/com/google/gwtexpui/globalkey/client/KeyCommandSet.java index b2a0f93..05d0104 100644 --- a/src/main/java/com/google/gwtexpui/globalkey/client/KeyCommandSet.java +++ b/src/main/java/com/google/gwtexpui/globalkey/client/KeyCommandSet.java @@ -112,6 +112,7 @@ public class KeyCommandSet implements KeyPressHandler { public void onKeyPress(final KeyPressEvent event) { final KeyCommand k = map.get(toMask(event)); if (k != null) { + event.preventDefault(); event.stopPropagation(); k.onKeyPress(event); } diff --git a/src/main/java/com/google/gwtexpui/globalkey/client/NpTextArea.java b/src/main/java/com/google/gwtexpui/globalkey/client/NpTextArea.java index 0ee49c8..c06d2c4 100644 --- a/src/main/java/com/google/gwtexpui/globalkey/client/NpTextArea.java +++ b/src/main/java/com/google/gwtexpui/globalkey/client/NpTextArea.java @@ -15,6 +15,7 @@ package com.google.gwtexpui.globalkey.client; import com.google.gwt.dom.client.Element; +import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.TextArea; public class NpTextArea extends TextArea { @@ -26,4 +27,8 @@ public class NpTextArea extends TextArea { super(element); addKeyPressHandler(GlobalKey.STOP_PROPAGATION); } + + public void setSpellCheck(boolean spell) { + DOM.setElementPropertyBoolean(getElement(), "spellcheck", spell); + } } |