Chrome Version: M59
OS: Android
What steps will reproduce the problem?(1) Type "Aaaa " text into a textarea.
(2) Tap in "Aaaa" to get the insertion handle between two letters.
(3) Tap the insertion handle
What is the expected result?
"Select All, Paste" floating menu
What happens instead?
"Aaaa" gets highlighted
In desktop chrome when you right click on a misspelled word (with the red underline) the word is highlighted and the context menu gets shown. aelias@, do you know how Blink makes this selection?
I can't repro on 59.0.3071.25, menu appears as expected. Are you sure
you're not double-tapping on the text itself?
Spelling is managed by DocumentMarker, but I don't follow how it can be
related to this.
> I can't repro on 59.0.3071.25, menu appears as expected. Are you sure
you're not double-tapping on the text itself?
I'm not double-tapping and am able to reproduce it consistently. Also if the word isn't misspelled then the menu appears as expected.
> Spelling is managed by DocumentMarker, but I don't follow how it can be
related to this.
After crrev.com/2721813002, tapping on an insertion handle sends a contextmenu MouseEvent. I believe that this contextmenu event on a misspelled word causes the word to get selected.
I think I figured out where the selection happens; it's in |SelectionController::SendContextMenuEvent()|. I'll have to keep track of whether or not the contextmenu comes from tapping an insertion handle and not make a selection in that case.
Per #c5, SelectionController::SendContextMenuEvent() has
if (HitTestResultIsMisspelled(mev.GetHitTestResult()))
return SelectClosestMisspellingFromMouseEvent(mev);
Note: GetEditor().Behavior().ShouldSelectOnContextualMenuClick() returns false except for Mac.
Comment 1 by amaralp@chromium.org
, May 2 2017