NEW246029
Text selection sometimes jumps back to original position on tap to change text selection
https://bugs.webkit.org/show_bug.cgi?id=246029
Summary Text selection sometimes jumps back to original position on tap to change tex...
mkuo
Reported 2022-10-04 10:41:33 PDT
Created attachment 462793 [details] Minimal repro Overview: In contenteditable div or textarea, sometimes when I try to move the text selection by tapping on text, the selection changes to position that I tapped, but then jumps back to the previous position. Steps to reproduce:
Attachments
Minimal repro (249 bytes, text/plain)
2022-10-04 10:41 PDT, mkuo
no flags
mkuo
Comment 1 2022-10-04 10:50:53 PDT
Steps to reproduce: 1. Open attached minimal repro in Safari iOS 2. Tap after a word, like after "the" 3. Then tap before the word 4. (If issue doesn't reproduce on first try, try repeating steps 2/3) Actual results: Sometimes, when tapping to change the text selection, the selection will change for a split second then jump back to the original position. I used Web Inspector to add an event listener on "selectionchange" events document.addEventListener('selectionchange', () => console.log(document.getSelection())) and saw that whenever the issue reproduces, one tap causes two "selectionchange" events (the first to the tapped position, the second back to the previous position). This *seems* to reproduce more frequently when the selection menu (menu with options to select/select all) is visible. Expected results: Tap to change the text selection changes the text selection to the position that was tapped. Browser/Hardware Safari on iPhone 13 mini on iOS 16.0.2
Radar WebKit Bug Importer
Comment 2 2022-10-11 10:42:18 PDT
Note You need to log in before you can comment on or make changes to this bug.