From fe77eb6140541a4bfb5932cad8b8c5ac11732dfd Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Tue, 1 Feb 2011 11:05:22 -0500 Subject: Only scroll if the IME is open in certain cases. Bug:3411564 Requires a change in external/webkit. Change-Id: I0a9a1d4ff99646e006716271f2cb1cdf0ad9b778 --- core/java/android/webkit/WebView.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/java/android/webkit/WebView.java') diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index fcfcc03..9b3a56b 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -7144,6 +7144,16 @@ public class WebView extends AbsoluteLayout setContentScrollTo(msg.arg1, msg.arg2); break; case SCROLL_TO_MSG_ID: + if (((Boolean) msg.obj).booleanValue()) { + // This scroll is intended to bring the textfield into + // view, but is only necessary if the IME is showing + InputMethodManager imm = InputMethodManager.peekInstance(); + if (imm == null || !imm.isAcceptingText() + || (!imm.isActive(WebView.this) && (!inEditingMode() + || !imm.isActive(mWebTextView)))) { + break; + } + } if (setContentScrollTo(msg.arg1, msg.arg2)) { // if we can't scroll to the exact position due to pin, // send a message to WebCore to re-scroll when we get a -- cgit v1.1