Re: [w3c/editing] Different browser behaviors when moving the caret by one word. (#278)

Would it be helpful for web authors to have something like a `beforeselectionchange` event (similar to `beforeinput`), which would inform authors where the selection is about to move and give them a way to change the default behavior?

I could imagine a selection change event similar to `InputEvent` that fires before updating the selection, and would contain a string similar to `InputEvent.inputType` that gives authors a hint as to what kind of selection modification the user is trying to perform (e.g. `"MoveWordBackwards"`), as well as the expected updated selection range or caret.

In general, this loosely reminds me of Input Events Level 2, in that we're looking for a way for the browser to communicate default behavior to the page, and let the page "fix up" or influence the default behavior if needed. However, whereas input events are just about text content modification (bolding, deleting, inserting, etc.), this would be limited to modifying the selection.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/278#issuecomment-797648513

Received on Friday, 12 March 2021 17:42:50 UTC