diff --git a/src/lib/components/common/CodeEditor.svelte b/src/lib/components/common/CodeEditor.svelte index 7a6a19536..e9769e0c6 100644 --- a/src/lib/components/common/CodeEditor.svelte +++ b/src/lib/components/common/CodeEditor.svelte @@ -31,11 +31,13 @@ } const updateValue = () => { - _value = value; - if (codeEditor) { - codeEditor.dispatch({ - changes: [{ from: 0, to: codeEditor.state.doc.length, insert: _value }] - }); + if (_value !== value) { + _value = value; + if (codeEditor) { + codeEditor.dispatch({ + changes: [{ from: 0, to: codeEditor.state.doc.length, insert: _value }] + }); + } } };