Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 961d55fe authored by Ben Murdoch's avatar Ben Murdoch
Browse files

Prevent autofilling directly after autofilling.

Clear the WebTextView's data adapter after autofill fills
out the form. This ensures that the dropdown disappears.

Change-Id: I2fd1e8b5d249f6ff3943d0a0b5d2f2b55beac70a
parent a6738744
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -648,6 +648,7 @@ public class WebView extends AbsoluteLayout
    static final int SAVE_WEBARCHIVE_FINISHED           = 132;

    static final int SET_AUTOFILLABLE                   = 133;
    static final int AUTOFILL_COMPLETE                  = 134;

    private static final int FIRST_PACKAGE_MSG_ID = SCROLL_TO_MSG_ID;
    private static final int LAST_PACKAGE_MSG_ID = SET_TOUCH_HIGHLIGHT_RECTS;
@@ -699,7 +700,8 @@ public class WebView extends AbsoluteLayout
        "SELECTION_STRING_CHANGED", //       = 130;
        "SET_TOUCH_HIGHLIGHT_RECTS", //      = 131;
        "SAVE_WEBARCHIVE_FINISHED", //       = 132;
        "SET_AUTOFILLABLE" //                = 133;
        "SET_AUTOFILLABLE", //               = 133;
        "AUTOFILL_COMPLETE" //               = 134;
    };

    // If the site doesn't use the viewport meta tag to specify the viewport,
@@ -7147,6 +7149,14 @@ public class WebView extends AbsoluteLayout
                    }
                    break;

                case AUTOFILL_COMPLETE:
                    if (mWebTextView != null) {
                        // Clear the WebTextView adapter when AutoFill finishes
                        // so that the drop down gets cleared.
                        mWebTextView.setAdapterCustom(null);
                    }
                    break;

                default:
                    super.handleMessage(msg);
                    break;
+2 −0
Original line number Diff line number Diff line
@@ -1512,6 +1512,8 @@ final class WebViewCore {

                        case AUTOFILL_FORM:
                            nativeAutoFillForm(msg.arg1);
                            mWebView.mPrivateHandler.obtainMessage(WebView.AUTOFILL_COMPLETE, null)
                                    .sendToTarget();
                            break;
                    }
                }