-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fixing selection after mutation is handled. #3060
Comments
Also we agreed on trying to do one big change that will insert/remove all changed letters instead of multiple one-by-one changes. |
The above will duplicate a bit work done in https://github.com/ckeditor/ckeditor5-typing/issues/48. In fact, it makes the current code there invalid. |
So, I know we've discussed it... But. Spellchecker scenario wouldn't work if the change was like "exmple" -> "example", it would be treated as typing. And autocorrect scenario is very similiar to typing anyway, so there wasn't much to do. So. As I don't like "targeted" solutions and prefer general ones I implemented solution basing on DOM selection. It works like this.
Please don't be mad at me. It works. BTW, as far as |
How is this going to affect undo? In fact, does it work this way that selection is stored once you press |
All those operations act like typing, so let's say that undo works like it works for typing. Some of changes done on undo and redo seems counter-intuitive because of how buffer works. But the results correctness should be satyisfying. |
I understood nothing. Did you answer my question? :D Or was it a random thought? :P |
I forgot you were asking in relation to |
This issue is a result of https://github.com/ckeditor/ckeditor5-engine/issues/399 .
We agreed that right now we will fix problems with selection during typing straight in the
Input
feature. We decided that we will come up with checks that will try to recognize what happened / what user did by checking what mutations were generated.Three scenarios that we want to handle right now are:
n
letters were inserted at the same position as selection position, and0
letters were removed -> move selection position byn
.n
letters were inserted andm
letters were removed, find word boundary after last change and place selection at that word boundary,n
letters were inserted andm
letters were removed, and last inserted letter was space character, move selection after that space character.The text was updated successfully, but these errors were encountered: