[w3c/selection-api] Add an event for "selection change attempt failure" (#112)

Sometimes, developer wants to know where the user attempts to move the caret in an editor, regardless whether it will actually succeed.

For example, when the caret is already after the last character in the editor, if the user still presses the "move-forward" arrow(Say, right/down arrow in a horizontal-tb or vertical-lr editor; or left/down arrow in a vertical-rl editor) to continue moving forward, it will fail, but the developer may sometimes want to be informed of the user's failed attempt.

One specific usage of such an event is implementing a syntax hightlighted editor, where each syntax unit is emulated by a contenteditable wrapup. Being able to informed of such failed attempts, it can be ensured technically correct to move among syntax units, without doing hacky code which may results in portability problems.

Thoughts about this? I look forward to hearing from you.

-- 
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/selection-api/issues/112

Received on Thursday, 29 August 2019 07:53:54 UTC