From 90e825f74368588073b1403b0681a89704eced06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milorad=20FIlipovi=C4=87?= Date: Fri, 4 Aug 2023 10:50:47 +0200 Subject: [PATCH] fix(editor): Fix value syncing in SQL and HTML editor (#6848) --- packages/editor-ui/src/components/HtmlEditor/HtmlEditor.vue | 3 ++- packages/editor-ui/src/components/SqlEditor/SqlEditor.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/editor-ui/src/components/HtmlEditor/HtmlEditor.vue b/packages/editor-ui/src/components/HtmlEditor/HtmlEditor.vue index 47f88002e2..95d92ff4ce 100644 --- a/packages/editor-ui/src/components/HtmlEditor/HtmlEditor.vue +++ b/packages/editor-ui/src/components/HtmlEditor/HtmlEditor.vue @@ -111,7 +111,8 @@ export default defineComponent({ this.getHighlighter()?.removeColor(this.editor, this.htmlSegments); this.getHighlighter()?.addColor(this.editor, this.resolvableSegments); - this.$emit('update:modelValue', this.doc); + // eslint-disable-next-line @typescript-eslint/no-base-to-string + this.$emit('update:modelValue', this.editor?.state.doc.toString()); }), ]; }, diff --git a/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue b/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue index 3e21361ded..04d0d03bdb 100644 --- a/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue +++ b/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue @@ -174,7 +174,7 @@ export default defineComponent({ highlighter.removeColor(this.editor as EditorView, this.plaintextSegments); highlighter.addColor(this.editor as EditorView, this.resolvableSegments); - this.$emit('update:modelValue', this.doc); + this.$emit('update:modelValue', this.editor?.state.doc.toString()); }), ); }