diff --git a/package.json b/package.json index ed99890..df25226 100644 --- a/package.json +++ b/package.json @@ -56,12 +56,12 @@ "@editorjs/table": "^2.0.1", "@editorjs/underline": "^1.0.0", "@editorjs/warning": "^1.2.0", - "editorjs-undo": "^2.0.5", "@itech-indrustries/editorjs-strikethrough": "^1.0.0", "directus-codestyle": "dimitrov-adrian/directus-codestyle", "editorjs-alert": "^1.0.3", "editorjs-list": "^2.1.4", "editorjs-text-alignment-blocktune": "^1.0.3", + "editorjs-undo": "^2.0.5", "lodash": "^4.17.21", "typescript": "^4.7.4" }, diff --git a/src/interface.vue b/src/interface.vue index af147d9..b4d5a5a 100644 --- a/src/interface.vue +++ b/src/interface.vue @@ -106,7 +106,7 @@ onMounted(() => { readOnly: false, placeholder: props.placeholder, minHeight: 72, - onChange: (a, b) => emitValue(a, b), + onChange: (a, b) => emitValue(a, b).finally(() => { isInternalChange.value = false; }), tools: tools, }); @@ -124,7 +124,12 @@ onUnmounted(() => { watch( () => props.value, async (newVal: any, oldVal: any) => { - if (!editorjsInstance.value || !editorjsInstance.value.isReady || isInternalChange.value) return; + if (!editorjsInstance.value || !editorjsInstance.value.isReady) return; + + if (isInternalChange.value) { + isInternalChange.value = false; + return; + } // Do not render if there is uploader active operation. if (fileHandler.value !== null) return;