summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/WebTextView.java
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2011-01-21 17:14:36 -0500
committerLeon Scroggins <scroggo@google.com>2011-01-21 17:14:36 -0500
commita51063c059d1e445c4a05829c8c93ac7dd64c1b1 (patch)
treed90048425f0c46eda27f5bd373153a822f3eb2c3 /core/java/android/webkit/WebTextView.java
parent17d25c564da50cfdcef6705ccc592ced2bd7c960 (diff)
Restart input when the webpage changes the text.
Bug:3375518 Change-Id: I0a18d0ca764ce428d86bd5f6d13f8764668acea6
Diffstat (limited to 'core/java/android/webkit/WebTextView.java')
-rw-r--r--core/java/android/webkit/WebTextView.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index 59a239ab9563..6e1a6fcba4bb 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -1087,7 +1087,7 @@ import junit.framework.Assert;
*/
/* package */ void setTextAndKeepSelection(String text) {
mPreChange = text.toString();
- Editable edit = (Editable) getText();
+ Editable edit = getText();
int selStart = Selection.getSelectionStart(edit);
int selEnd = Selection.getSelectionEnd(edit);
mInSetTextAndKeepSelection = true;
@@ -1097,6 +1097,12 @@ import junit.framework.Assert;
if (selEnd > newLength) selEnd = newLength;
Selection.setSelection(edit, selStart, selEnd);
mInSetTextAndKeepSelection = false;
+ InputMethodManager imm = InputMethodManager.peekInstance();
+ if (imm != null && imm.isActive(this)) {
+ // Since the text has changed, do not allow the IME to replace the
+ // existing text as though it were a completion.
+ imm.restartInput(this);
+ }
updateCachedTextfield();
}