-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Decoration update while dead key is still active breaks backspace #1310
Comments
Your decoration widget will (by default) appear in front of the cursor when the cursor is at its precise position. That means the editor must render it between the cursor and the composed text. But doing that will unfortunately cause the browser to abort the composition and/or do the weird buggy things you're seeing. Adding |
That does seem to fix the problem in my reproduction. However, in my real application the problematic widget decoration is generated by the lint extension, which does not specify a side. Is there a way to apply this solution there? |
Attached patch adds a kludge that, in this specific situation, avoids moving the DOM selection. The widget will show up on the wrong side of the cursor until the composition finishes, but that seems preferable to interrupting composition. |
Great, thanks! I can confirm that this fixes the issue. |
Describe the issue
When a particular decoration update (mark + widget, as seen in the reproduction) is dispatched after a document update with a dead key, pressing backspace does nothing. In the same scenario, typing the dead key again inserts it twice into the editor.
How to reproduce:
Browser and platform
Chrome, macOS, German Keyboard
Reproduction link
https://github.com/laurmaedje/codemirror-deco-bug
The text was updated successfully, but these errors were encountered: