diff --git a/src/domchange.ts b/src/domchange.ts index 1aa80bf..a456dc2 100644 --- a/src/domchange.ts +++ b/src/domchange.ts @@ -15,8 +15,10 @@ export class DOMChange { } | null = null text: string = "" newSel: EditorSelection | null + domChanged: boolean constructor(view: EditorView, start: number, end: number, readonly typeOver: boolean) { + this.domChanged = start > -1 let {impreciseHead: iHead, impreciseAnchor: iAnchor} = view.docView if (view.state.readOnly && start > -1) { // Ignore changes when the editor is read-only diff --git a/src/domobserver.ts b/src/domobserver.ts index 4b4f065..92a3e7d 100644 --- a/src/domobserver.ts +++ b/src/domobserver.ts @@ -381,7 +381,7 @@ export class DOMObserver { let handled = applyDOMChange(this.view, domChange) // The view wasn't updated but DOM/selection changes were seen. Reset the view. if (this.view.state == startState && - (domChange.bounds || domChange.newSel && !domChange.newSel.main.eq(this.view.state.selection.main))) + (domChange.domChanged || domChange.newSel && !domChange.newSel.main.eq(this.view.state.selection.main))) this.view.update([]) return handled }