From 1cc2420d0dfaef8ec0d510b6aa85ecbadf0f62f7 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Tue, 16 Jun 2009 10:10:28 -0400 Subject: [PATCH] Bring up the WebTextView when pressing a key on textfield. The old code put the textfield in focus, and resulted in editing the text semi-appropriately, but now we actually bring up the WebTextView so that we properly handle the arrow keys, as well as any substitution that is necessary. This fixes http://b/issue?id=1918883 --- core/java/android/webkit/WebView.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index e9a51dffefeb5..41e007ea32a4e 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3190,7 +3190,16 @@ public class WebView extends AbsoluteLayout } if (nativeCursorWantsKeyEvents() && !nativeCursorMatchesFocus()) { + // This message will put the node in focus, for the DOM's notion + // of focus mWebViewCore.sendMessage(EventHub.CLICK); + if (nativeCursorIsTextInput()) { + // This will bring up the WebTextView and put it in focus, for + // our view system's notion of focus + rebuildWebTextView(); + // Now we need to pass the event to it + return mWebTextView.onKeyDown(keyCode, event); + } } // TODO: should we pass all the keys to DOM or check the meta tag