-
-
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
Handle composition #3033
Comments
Note that |
I wouldn't risk rendering during composition. It's simply too dangerous. |
I can see now that composition is totally broken. It worked before, so either it's been broken in v0.2.0 or something has changed in Chrome. |
Yep, something got much worse in v0.2.0. You can compare it with https://ckeditor5.github.io/releases/v0.1.0/. |
Using the suggested code I rechecked composition events flow for:
Each list contains events in order of execution, each event info includes: Chrome1.
2.
Safari1.
2.
3.
Firefox1.
2.
3.
Edge1. - 2. Accented letter is inserted after pressing
3. The key sequence consist of 3
Base on the above, it seems that |
It should be fine as long as we don't re-render the DOM after the accent character is typed. If the renderer works correctly the DOM should not be changed so we should be fine.
Fortunately, we don't depend on the keydown for this, so it should not cause issues either. |
One thing to notice is that, when using MacOS accent balloon and selecting the accent using number keys (instead of mouse or arrow keys navigation) the composition events are not fired. Instead only key events are fired:
This is not a problem as proper mutations are fired after accent is inserted. |
Created a PR in engine ckeditor/ckeditor5-engine#861 which blocks rendering during composition. There is one change required in typing package. During the Hiragana (and probably others too) composition the whole composing text (or its part in some specific cases) is selected, so while pressing enter to confirm selected text in IME dialog the keydown "hack" is fired and removes compostion from the model/view. |
Another case here: #748. |
Resolved once we migrated to beforeInput. |
Main requirement here is to not touch the DOM and selection while user is composing a text. The only re-rendering can take place when composition finishes. That's what should satisfy the simple cases.
In more complex one we may need to handle situations similar to autocorrection and spellchecking (see ckeditor/ckeditor5-typing#3).
Requires: https://github.com/ckeditor/ckeditor5-engine/issues/460.
The text was updated successfully, but these errors were encountered: