-
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
How does cE=typing work with overtype (insert key is on) #28
Comments
There are a few ways to approach this:
Number 3 is not that different from autocorrect as I currently envision it, but we haven't talked about how autocorrect works in cE=typing. I don't know what the right answer is but we should try to make it so that autocorrect, overwrite, IMEs and any other mode that may want to modify text nodes beyond simple insertion all work in similar ways. |
I'm starting to think that simple delete operations should be handled in cE=typing. This may be true for the DEL/BACKSPACE keys as well. It is a matter of defining the cases that can be handled. Much probably the case is pretty simply: collapsed selection next to a character (present in next or following text nodes). If any element is in the path, nothing happens but the intention event is fired anyway, allowing js to (1) move the selection to an appropriate place where the browser can perform deletion or (2) perform the deletion by itself. |
I don't think so. It would be extremely confusing for developers if only some deletions result in DOM modifications. Also, a simple case that results in a trimming of a single character in a Text node can trivially be implemented in JS. |
I agree.
I don't think that putting overwrite (OW) in the same basket as autocorrect (AC) and IME is right. While OW must work over complex DOM structures (e.g.
|
OW can also be modeled as a forward delete immediately followed by an input. That might be better than forcing authors to support two modes of "typing". |
@rniwa by DOM modifications do you mean Element node modifications or any node modification (including text nodes)? Should we decide that cE=typing has a default action for backspace and delete then I believe this default behavior would only affect text nodes. The behavior would be to eliminate the character just before the caret (in the case of backspace), and if the character is at offset=0 of a text node, then it finds the previous text node and continues there. It would be up to the editor dev to clean up empty Element nodes as this happens, or relocate the caret as necessary before allowing the event to continue. I think this would be reasonable.
@fredck agreed. Not only that, but more critically OW is a "combination intent": Delete + Insert in one default behavior. As we've seen a few months ago combo events are bad because the editor dev can't prevent one part but not the other.
@fredck are we sure of this wrt to AC? Try putting On the one hand "real" text editors should be able to autocorrect partially-styled words. On the other, given we're trying to do something minimalist and workable with cE=typing maybe we could spec that autocorrect only operates on individual text nodes. We could tackle a full fledged AC API in V2. |
So far cE=typing has been all about touching/producing text nodes only. Therefore I think we should indeed keep things simple and stick with this approach... at least for v1. |
End users don't care whether a word reside entirely inside a single text node or appears across multiple text nodes/elements. It would be a terrible user experience if autocorrection worked only in some cases. As such, I'm strongly opposed to making anything work just in text nodes. |
Since this issue is about Overtype and it seems we won't treat AC, OW and IMEs all the same, I created a new issue for discussing AC: #37 with my thoughts. Let's continue that discussion there. |
This seems to be covered by the current draft. Please reopen if I am wrong. |
From MS Office Team
The text was updated successfully, but these errors were encountered: