-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
closeBrackets() crashes Tab with single or double quotes #1188
Comments
Could you please say, in words, which keys I have to press to reproduce this? Also, you mention crashing the tab, but I see the video end with the focus moved to the textarea below the editor and the cursor still blinking. |
I don't have this 'autocomplete' that adds a single quote after typing |
This is the exact key sequence I typed: Then the autocomplete includes automatically the extra ' and the ) when I press hmm and maybe it is something related to the javascript autocomplete, because if I type |
Screen.Recording.2023-06-23.at.2.12.01.PM.movInteresting in this video above, I used the accessibility keyboard to show the keys I pressed. Notice when I type the second ' the keyboard shows the accent characters and the shows the extra '. So, on keyboards with accent, some keys has 2 stages, one for the accent like ' and the second to see if you will type a letter that could be combined. This is the same thing for ", because you have, for example, ä in German (" + a). I hope it helps. |
also Marijn, I see here: https://github.com/codemirror/lang-javascript/blob/main/src/javascript.ts#L49C2-L54C4
that maybe the single quote ("'") is being used on closeBrackets? I didn't investigate further though. |
Thanks, I managed to reproduce it. Was an obscure interaction between the way compositions are handled and an optimization in the way the content DOM was updated. Attached patch should help. |
Awesome Marijn, thanks a lot. |
Describe the issue
The issue happens when I try to write single or double quoted strings like in the example below:
Screen.Recording.2023-06-21.at.11.35.37.PM.mov
This video was recorded using the preview code editor on this page: https://codemirror.net/examples/tab/
I am using the U.S. International keyboard layout on macOS, and I believe this happens because of the accent marks. When I use the U.S. keyboard layout only, the problem doesn't happen.
The problem is related to
closeBrackets
on@codemirror/autocomplete
because it doesn't happen if I remove the extension.Browser and platform
U.S. International keyboard layout, MacOs, Chrome
Reproduction link
No response
The text was updated successfully, but these errors were encountered: