Closed jclem closed 5 months ago
Oh, that's disappointing — they didn't implement their own spec, which explicitly says inverted selections are supported, properly.
I guess I'll push an emergency patch to turn EditContext
integration off for the time being until we sort this out. Thanks for reporting these.
Thanks! Note that the MDN docs do mention that this is an exception: https://developer.mozilla.org/en-US/docs/Web/API/EditContext/updateSelection#exceptions
If start is greater than end, a DOMException is thrown.
(Although the MDN docs != the spec of course)
This is fixed in Chrome 126. I've pushed a patch that disables EditContext
use for older browser versions.
@marijnh Thank you! This was in Electron, which I guess is why I ran into it. Also explains why I couldn't reproduce it with plain old Vite in Chrome.
Describe the issue
This is reproducible with the basic setup when using the EditContext API. CodeMirror will call
editContext.updateSelection()
with a start > end value, which is a DOMException.Browser and platform
Chrome
Reproduction link
No response