diff --git a/src/lib/codemirror.component.ts b/src/lib/codemirror.component.ts index aee742f..e552e0b 100644 --- a/src/lib/codemirror.component.ts +++ b/src/lib/codemirror.component.ts @@ -169,8 +169,9 @@ export class CodemirrorComponent } } codemirrorValueChanged(cm: Editor, change: EditorChangeLinkedList): void { - if (change.origin !== 'setValue') { - this.value = cm.getValue(); + const cmVal = cm.getValue(); + if (this.value !== cmVal) { + this.value = cmVal; this.onChange(this.value); } }