diff options
author | John Reck <jreck@google.com> | 2011-11-16 16:58:56 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-11-16 16:58:56 -0800 |
commit | f9a6c91f75a4f08543b045435fd795f475e7e879 (patch) | |
tree | e3fc3e5fcda02e3f35aaefadfa1e6a032a9eef5b /core | |
parent | c7403258528a08ab74f7c29277d0c34ba6edc53d (diff) | |
download | frameworks_base-f9a6c91f75a4f08543b045435fd795f475e7e879.zip frameworks_base-f9a6c91f75a4f08543b045435fd795f475e7e879.tar.gz frameworks_base-f9a6c91f75a4f08543b045435fd795f475e7e879.tar.bz2 |
Fix add single character check
Bug: 5618801
Change-Id: I42a19855b188c9175b8f7a293faa96027685052c
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/webkit/WebTextView.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index 8aafc3d..8c7a49c 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -567,7 +567,6 @@ import java.util.ArrayList; mPreChange.substring(0, mMaxLength).equals(postChange))) { return; } - mPreChange = postChange; if (0 == count) { if (before > 0) { // For this and all changes to the text, update our cache @@ -605,9 +604,9 @@ import java.util.ArrayList; // Prefer sending javascript events, so when adding one character, // don't replace the unchanged text. if (count > 1 && before == count - 1) { - String replaceButOne = s.subSequence(start, + String replaceButOne = mPreChange.subSequence(start, start + before).toString(); - String replacedString = getText().subSequence(start, + String replacedString = s.subSequence(start, start + before).toString(); if (replaceButOne.equals(replacedString)) { // we're just adding one character @@ -616,6 +615,7 @@ import java.util.ArrayList; count = 1; } } + mPreChange = postChange; // Find the last character being replaced. If it can be represented by // events, we will pass them to native so we can see javascript events. // Otherwise, replace the text being changed in the textfield. |