Here is the minimal code I’ve written to reproduce the issue:
Contribute to miaobuao/prosemirror-baseKeymap-reproduction development by creating an account on GitHub.
Steps to Reproduce
Switch to the Chinese input method.
Press Ctrl+A to select all the text in the editor.
Press Backspace to delete the text.
Enter any Chinese characters.
You will notice that the input method closes immediately after pressing the letter a
.
marijn
November 13, 2024, 9:08am
2
Does the problem also occur in the demo editor on prosemirror.net ? What browsers and platform did you test on?
Thank you for your reply. This only happens with WebComponents created with lit . This does not happen in the official example.
You can see my reproduction code here
My env:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0
marijn
November 13, 2024, 10:32am
5
I’m not going to debug the lit code, but I suspect what may be happening is that the editor gets redrawn on every update, which will absolutely break the browser’s IME composition state.
Thanks again for your reply!
But the problem only occurs when typing the first character
It seems that shadow dom is causing the problem. When I rendered the template as a child of the element in the main DOM tree, the problem went away!