Pasting text into input field does not close Android's "PASTE | SELECT ALL" context menu

RESOLVED FIXED in Firefox 68

Status

defect
P1
normal
RESOLVED FIXED
4 months ago
4 months ago

People

(Reporter: cpeterson, Assigned: fluffyemily)

Tracking

unspecified
mozilla68
All
Android

Firefox Tracking Flags

(firefox66 wontfix, firefox67 wontfix, firefox68 fixed)

Details

(Whiteboard: [geckoview:fenix:m5])

Attachments

(1 attachment)

This bug was originally reported in the Focus issue tracker:
https://github.com/mozilla-mobile/focus-android/issues/4256

STR:

  1. Copy some word from a web page.
  2. Load https://google.com.
  3. Tap google.com's search field and paste the copied word.

RESULT:
The word is pasted into the search field, but Android's "PASTE | SELECT ALL" context menu stays open instead of closing.

I can reproduce this bug in Focus 8.0.8 (GV 65) and Fenix (GV 68).

Assignee: nobody → etoop

This issue was caused by the updating of the caret position after the paste occurs firing an updateposition event resulting in an GeckoView:ShowSelectionAction message to reposition context menu without any attempt to close the context menu. The solution is to hide the context menu before the repositioning of the caret occurs such that the updateposition event doesn't trigger a redisplay.

I tried several versions of this trying to trigger the menu close from inside GeckoViewSelectionActionDelegate, including making the call to docShell.doCommand("cmd_paste"); asynchronous and firing ACTION_HIDE before firing ACTION_PASTE, but the result is always the same - one of the events is processed before the other and so the second event is rejected as a stale response.

Therefore we are firing the pagehide from inside the code that performs the paste. This has to be done before the paste occurs otherwise the updateposition event is fired before the page hide event and the context menu redisplays before being hidden.

Pushed by etoop@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6057bafee921
Ensure that the context menu is closed when performing a paste. r=geckoview-reviewers,droeh

Emily, does Fennec have this same bug?

Flags: needinfo?(etoop)
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

No, this was GeckoView only.

Flags: needinfo?(etoop)

(In reply to Emily Toop (:fluffyemily) from comment #5)

No, this was GeckoView only.

Cool. Setting 67=wontfix.

You need to log in before you can comment on or make changes to this bug.