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

Commit 244d2d4e authored by Leon Scroggins's avatar Leon Scroggins
Browse files

Delay message for <select> choice.

Bug:3230016

Pass the message after the page is set to active, which
calls a focus event, which may modify the page.

Change-Id: I594ba30a7a105595b27bc0356c164c41e48dcd15
parent da3d5e65
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -4828,6 +4828,11 @@ public class WebView extends AbsoluteLayout
    /* package */ void setFocusControllerActive(boolean active) {
        if (mWebViewCore == null) return;
        mWebViewCore.sendMessage(EventHub.SET_ACTIVE, active ? 1 : 0, 0);
        // Need to send this message after the document regains focus.
        if (active && mListBoxMessage != null) {
            mWebViewCore.sendMessage(mListBoxMessage);
            mListBoxMessage = null;
        }
    }

    @Override
@@ -7429,7 +7434,9 @@ public class WebView extends AbsoluteLayout
                listView.setOnItemClickListener(new OnItemClickListener() {
                    public void onItemClick(AdapterView parent, View v,
                            int position, long id) {
                        mWebViewCore.sendMessage(
                        // Rather than sending the message right away, send it
                        // after the page regains focus.
                        mListBoxMessage = Message.obtain(null,
                                EventHub.SINGLE_LISTBOX_CHOICE, (int) id, 0);
                        mListBoxDialog.dismiss();
                        mListBoxDialog = null;
@@ -7455,6 +7462,8 @@ public class WebView extends AbsoluteLayout
        }
    }

    private Message mListBoxMessage;

    /*
     * Request a dropdown menu for a listbox with multiple selection.
     *