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] Word deletion #125
Comments
Also I was wondering is there any particular reason we want to use @ojanvafai seems disagree with |
@choniong Forward and backward give an indication of where the caret will be after the deletion. In the most simple case -- content is just being deleted -- it won't make a difference. But if the JS interrupts the deletion and does something else -- for example for a tracked changes feature where the content will be crossed out rather than actually deleted -- it matters which direction the deletion is happening in. For example: [...] = selection, | = collapsed selection
User hits BackSpace or Delete. In a simple case (and default behavior if deletion is enabled) the result is:
In a tracked changes situation, it is important to be able to differentiate between the result of BackSpace:
And Delete
|
@ayg Indeed. I think we need DeleteWordBackward and DeleteWordForward as well. |
@johanneswilm reusing the data field for this makes no sense to me. That's the part I'm objecting to. If we had DeleteForward, DeleteBackword, DeleteWordBackword and DeleteWordForward, does that solve the same problem without needing to use the data field? @choniong I was confused in our code review...I don't think the data field should have any value for these command types. I guess it should be null? Instead, the target range should point to what's going to be deleted. |
@ojanvafai: Yes, I agree. I think that solves everything, and it's much cleaner. |
@ojanvafai sorry for misunderstanding your comments... BTW do we care about Line deletion? e.g. Command+Backspace on Mac |
What makes the most sense to me is to have a different edit type for each of these. So we'd have DeleteLineBackward and DeleteLineForward as well. That gives web authors the ability to understand the semantic thing the user was trying to do and react appropriately instead of needing to reverse engineer what the user was trying to do from the target range. FWIW, you didn't misunderstand my comments, I just said something wrong. :) |
I would want to put this into the draft immediately. However, the current way of doing it is the result of a resolution at our F2F meeting "RESOLUTION: one delete event with data for forward/backward". It used to be two different types. I have sent a mail about this to the mailing list: https://lists.w3.org/Archives/Public/public-editing-tf/2016Apr/0011.html |
FWIW, I'm open to other solutions as well. We could add a new field to the On Fri, Apr 22, 2016 at 7:26 AM Johannes Wilm notifications@github.com
|
If Mac supports line deletion, we should definitely support that as well. Firefox has code for it. Having separate inputTypes sounds like the best idea to me. |
Having different inputTypes or having a new field both seem like reasonable suggestions. it seems like here most favor different inputTypes, and there has been no protest on the list about it either. |
I have tried to contact those who according to the minutes seemed to have an interest in this question, and I have only received no response or positive responses toward the above mentioned proposal of splitting it into several. It seems that all possible effort has been made to see if there were opposing views. I will therefore now make the change in the draft. |
…eteLine/deleteWord/deleteContent/deleteComposedCharacter[Backward/Forward], #125
I tried to figure out how to define deleteContent as opposed to deleteLine and deleteWord. At frist I thought maybe saying the user wants to delete a character. But it may actually be at the start of a block element, so that deleteContentBackward would indicate a wish to merge paragraphs. Or it may be after a table, in which case it may mean to wish to delete the entire table. So I added to the description "this intention is not covered by another inputType" (and such other inputTypes would be deleteLine/deleteWord). But I'm not sure that is the best possible way of formulating it. This hasn't been talked about, but what makes out a word or a line can be difficult to figure out. So probably it would be a good idea to have the target range point to what the the browser thinks is a line or a word in the given direction. Then the author can decide whether to go with the browser's idea of a word/line or whether to define his/her own. |
Changed in draft document. Closing this issue. |
The spec knows about "forward" and "backward". But you can also do word deletion by holding down Ctrl with backspace/delete.
The text was updated successfully, but these errors were encountered: