Skip to content

Commit

Permalink
Disable edit context for Chrome versions below 126
Browse files Browse the repository at this point in the history
Because those do not support inverted selections.

FIX: Only use `EditContext` on Chrome versions that support passing it
an inverted selection range.

Closes codemirror/dev#1392
  • Loading branch information
marijnh committed Jun 13, 2024
1 parent ef86540 commit a943e6c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/domobserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ export class DOMObserver {
this.flush()
})

if (window.EditContext && (view.constructor as any).EDIT_CONTEXT === true) {
if (window.EditContext && (view.constructor as any).EDIT_CONTEXT === true &&
// Chrome <126 doesn't support inverted selections in edit context (#1392)
!(browser.chrome && browser.chrome_version < 126)) {
this.editContext = new EditContextManager(view)
if (view.state.facet(editable))
view.contentDOM.editContext = this.editContext.editContext
Expand Down

0 comments on commit a943e6c

Please sign in to comment.