mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user