-
Notifications
You must be signed in to change notification settings - Fork 39
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
[beforeinput] Add InputType 'deleteByKill', 'insertFromYank' and 'transpose' #148
Comments
What is the usecase for this? Typing errors? |
Did some search and cannot find more info about it...(I don't actually use it) I think it's not worth adding new InputTypes since nobody uses it (I assume?), but as they are modifying DOM we should at least have some notes about the expected events, e.g.:
|
I think this has to depend on, whether someone uses it (as you say) and whether this functionality can be interpreted in some way to make a change of semantic significance that applies to a different range than the default handling. For example, how does ctrl+t behave around element boundaries? Does it only ever make changes within a single text node? |
It won't pass editing boundary nor paragraph boundary.
It could pass Apple's reference NSResponder - transpose:. |
I see. Then this may be somewhat more complicated. Element boundaries have at times a meaning within the editor that the browser isn't aware of. Say for example, that a particular editor puts span-elements around all words or syllables if the word is longer than ten letters for the purpose of tracking their position or alike. As long as the spans are not styled, the end user doesn't notice this. If now the user intents to "transpose" two characters, but the JS doesn't ever know that this was the intention of the end user and instead only gets to know that the end user has asked for changing some things in and out of two span-elements that happen to end/start in-between the two letters in question, this could lead to all kinds of misunderstandings. Does this makes ense? So I would say this has to get its own intention. Same with yank/kill. It doesn't take that much for us to define them, and if Apple finds out that really no-one uses them, they can remove them from Mac OS X and we can remove them from a future version of the spec. |
OK, so for example the default behavior for
JS might want to detect
OK, so how about:
|
That's possible. I was thinking of a case such as:
The spans above are something used by the JS editor and what the meaning of
That sounds good to me. |
This issue was moved to w3c/input-events#20 |
On MacOS the hotkey
ctrl-t
will transpose the two character besides cursor (Chrome and Safari), e.g.Should we:
InputType
, orinsertText
with the target range?The text was updated successfully, but these errors were encountered: