-
Notifications
You must be signed in to change notification settings - Fork 30
Add beforeselectionchange event #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think if we're doing this, we need to make it so that only user-initiated selection change triggers this event as in selectstart event. Otherwise, it would become an implementation nightmare. |
I agree. Just like |
I agree as well. |
|
@rniwa Now that the beforeinput event is shipping, I am being asked about the status of beforeselectionchange. Do we have a timetable for when we are going to move ahead with this? |
There would be definite benefit for this event, especially if (along the lines of the detailed Similarly whatever typical caret movements OS environments standardise for "move caret" or "extend selection" to previous/next glyph/word/paragraph/page/document start/endpoint, and so on, so web developers don't have to guess what raw editing actions their users expect to have such semantics. |
I think the event can be renamed to something else, and it can only be triggered when the change attempt is going to fail. |
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. Only then the event can be triggered. |
The problem is that whether a movement fail or not is not obvious to the browser. In the case the app itself is drawing selection for example, the browser has no idea whether the selection had moved or not even, |
Quoting @johanneswilm from w3c/editing#73:
The text was updated successfully, but these errors were encountered: