gecko-dev/mobile
Emily Toop 3fd2272331 Bug 1546851 - Ensure that the context menu is closed when performing a paste. r=geckoview-reviewers,droeh
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.

Differential Revision: https://phabricator.services.mozilla.com/D29665

--HG--
extra : moz-landing-system : lando
2019-05-02 15:06:58 +00:00
..
android Bug 1546851 - Ensure that the context menu is closed when performing a paste. r=geckoview-reviewers,droeh 2019-05-02 15:06:58 +00:00
locales Bug 1523741 - Converting legacy aboutTelemetry to Fluent aboutTelemetry, r=jaws,flod,Gijs 2019-04-08 09:15:16 +00:00