-
Notifications
You must be signed in to change notification settings - Fork 94
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
Don't apply author annotations when in composition #3350
Conversation
Maybe it would be good to have tests for this to prevent regressions. Probably needs an e2e cypress test. Would be curious if you think it's testable in jest. |
Might not even be testable in cypress if using a chromium based browser. Iirc firefox introduced a slightly different handling of compose keys. |
I checked and the issue only seems to occure in firefox. So yes... will be hard to test in chrome. |
/rebase |
When typing dead keys (like diacritics), the browser is in composition mode[1] until the accompanioning character is typed. This breaks author annotations. We have to hold back the transaction when in composition and only apply it afterwards, as suggested at [2]. So check for `view.composing` before applying the transaction. Fixes: #2871 [1] https://w3c.github.io/uievents/#events-compositionevents [2] https://discuss.prosemirror.net/t/plugins-and-characters-with-a-diacritic/2674/3 Signed-off-by: Jonas <jonas@freesources.org>
b14542c
to
d1b10e0
Compare
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Also had a brief look at tiptap tests and prosemirror tests. Tiptap runs all tests in cypress - but sometimes they are just plain js tests. Prosemirror has an explicit test for composition: https://github.com/ProseMirror/prosemirror-view/blob/master/test/webtest-composition.ts So i don't see a way of testing this right now that would be somewhat reasonable to achieve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried it in my local firefox and it fixes the issue.
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
/backport to stable25 |
/backport to stable24 |
The backport to stable25 failed. Please do this backport manually. |
The backport to stable24 failed. Please do this backport manually. |
/backport d1b10e0 to stable25 |
/backport d1b10e0 to stable24 |
When typing dead keys (like diacritics), the browser is in composition mode[1] until the accompanioning character is typed. This breaks author annotations.
We have to hold back the transaction when in composition and only apply it afterwards, as suggested at [2]. So check for
view.composing
before applying the transaction.Fixes: #2871
[1] https://w3c.github.io/uievents/#events-compositionevents
[2] https://discuss.prosemirror.net/t/plugins-and-characters-with-a-diacritic/2674/3
Signed-off-by: Jonas jonas@freesources.org
Summary