Notes on events that are fired during text selection in current desktop and mobile browsers.
Testing steps:
- Serve
test.html
from local dev server and open on device - Make an initial selection via long-press on the text, observing reported events
- Modify the selection using drag handles and observe reported events
During initial selection by long-pressing a word, Safari logs:
touchstart
selectionchange
touchend
During subsequent edits by dragging the start/end markers on the text, the selectionchange
event is fired each time the selection markers are adjusted. None of the other watched events are fired.
The selectstart
event is never fired.
During initial selection by long-pressing a word, these events were fired:
touchstart
selectstart
selectionchange
Adjusting the selection using the drag handles resulted in selectionchange
events but no further touch events.
During initial selection by long-pressing a word, these events were fired:
touchstart
Adjusting the selection using the drag handles resulted in no further touch, mouse or selection events.
During initial selection by long-pressing a word, these events were fired:
touchstart
selectstart
selectionchange
touchend
Adjusting the selection using the drag handles triggered selectionchange
events but no further touch events.
Hello,
Has anything changed in 2019?
Thanks.