codemirror / dev

Development repository for the CodeMirror editor project
https://codemirror.net/
Other
5.94k stars 377 forks source link

Spell check fixing broken as of 6.28.0+ #1415

Closed zefhemel closed 3 months ago

zefhemel commented 3 months ago

Describe the issue

I'm using spellcheck="true" on my CodeMirror editor to enable native browser spell checking. Until @codemirror/view 6.28.0 this worked fine, it detected spelling errors and right clicking on a correct spelling would replace it in line. As of 6.28.0 this functionality is broken, however — it simply doesn't change the text anymore.

CleanShot 2024-07-29 at 12 03 40

In any version of @codemirror/view beyond 6.28.0 this is the case, so 6.27.0 still works.

Browser and platform

Chrome, testing on macOS

Reproduction link

No response

marijnh commented 3 months ago

Apparently enabling Chrome's new EditContext feature blocks it from applying these kinds of corrections. Attached patch hooks into the beforeinput events they fire to actively apply them ourselves.

zefhemel commented 3 months ago

Awesome, thanks a lot for the quick fix!