Don't apply author annotations when in composition#3350
Don't apply author annotations when in composition#3350max-nextcloud merged 2 commits intomasterfrom
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. |
max-nextcloud
left a comment
There was a problem hiding this comment.
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.composingbefore 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