-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Input Events] Why are insertText and replaceContent separate events? #124
Comments
insertText is specifically limited to text. This used to be "insertCharacter" which maybe gave a better explanation for what was happening. In the JavaScript part one will likely deal quite differently with characters the user types and content that can potentially contain more complex DOM structures. So if the two were joined together, JavaScript authors would likely have to go through the inserted content to try to figure out if this is richtext content or whether it is about plaintext characters/text. See also discussion at #118 |
Okay, but then why not call it insertContent? Why replaceContent? Also, how can the user insert non-text content, other than by pasting, which is already handled by the paste event? |
That name may work as well.
By dragging, or by using the spellcheck function which may work across DOM boundaries. There may be more such checkers in the future. |
I suggest replacing "using a keyboard, IME, speech, or similar method" in the spec for replaceContent with something like "using spellcheck, drag-and-drop, or similar method" to clarify that it's not meant to deal with regular input. Also, is it meant to cover paste and drag-and-drop, even though there are existing events (paste and drop events)? It may make sense to have one event that can be used to catch all such modifications, but perhaps it should have a field specifying the cause of the event. |
This is still under discussion. See https://lists.w3.org/Archives/Public/public-webapps/2016JanMar/0083.html |
@johanneswilm: Do you think we should create an issue (that if it has not been done already) for renaming "replaceContent" with "insertContent"? |
@gked: I think that sounds like a good idea. |
With the recently opened issue #126, it seems this issue has been dealt with and can be closed. Please reopen if assumption was mistaken. |
Isn't replacing content just inserting content in the case where the selection is not collapsed?
The text was updated successfully, but these errors were encountered: