After receiving many bug reports of the editor freezing while typing in Chinese and Japanese, despite having no debugging capabilities once the entire app (or safari page) freezes, I have found a weird combination on https://codemirror.net/6/ that can repro this bug!
(See picture below) Use remote debugger from macOS safari to add the css white-space: pre-wrap to the content element .cm-content.
Zoom out to see the full width of the page. (For some reason this step seems to be required)
Use the Chinese IME to type "a", then space to confirm the conversion, repeat until the entire browser page freezes. Sometimes this takes 20-30 tries, or until the line wraps. Sometimes this happens a few characters in.
Notice that remote debugger is completely frozen and no commands work, including pausing script execution.
Video attached.
Extra information that might be helpful:
In my testing, disabling drawSelection seems to fix this issue, but it is required to use allowMultipleSelections. Disabling line wrapping also fixes it. It seems that this is a unique combination that's causing the issue.
In the video, once it's frozen, despite the cursor still blinking, I am trying to type many keys. Later, when the keyboard is closed, I am attempting to scroll the page.
When this issue happens, my device gets hot, suggesting that it may have ran into an infinite loop somewhere.
RPReplay_Final1622523711.mp4
The text was updated successfully, but these errors were encountered:
Well, that was fun to debug—Mobile Safari goes completely black-hole once it hits an infinite loop, not letting any information escape from its bowels. Fortunately I found a way to reliably trigger this issue, so I just kept moving early return statements around until I found out where the problem comes from. And it was a dumb bug in the library itself—see attached patch.
After receiving many bug reports of the editor freezing while typing in Chinese and Japanese, despite having no debugging capabilities once the entire app (or safari page) freezes, I have found a weird combination on https://codemirror.net/6/ that can repro this bug!
Steps to repro:
white-space: pre-wrapto the content element.cm-content.Extra information that might be helpful:
drawSelectionseems to fix this issue, but it is required to useallowMultipleSelections. Disabling line wrapping also fixes it. It seems that this is a unique combination that's causing the issue.RPReplay_Final1622523711.mp4
The text was updated successfully, but these errors were encountered: