Only emit value if updated for wysiwyg interface (#14216)

* Only emit value if updated for wysiwyg interface

* Update app/src/interfaces/input-rich-text-html/input-rich-text-html.vue

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
ian
2022-06-30 21:51:43 +08:00
committed by GitHub
parent ae458384f6
commit 449e87ab27

View File

@@ -376,6 +376,7 @@ export default defineComponent({
const percRemaining = computed(() => percentage(count.value, props.softLength) ?? 100);
let observer: MutationObserver;
let emittedValue: any;
return {
t,
@@ -427,7 +428,12 @@ export default defineComponent({
if (!observer) return;
emit('input', editorRef.value.getContent() ? editorRef.value.getContent() : null);
const newValue = editorRef.value.getContent() ? editorRef.value.getContent() : null;
if (newValue === emittedValue) return;
emittedValue = newValue;
emit('input', newValue);
}
function setupContentWatcher() {