From a0d6ff976f9e5f752fa4939377effe3d9ce482c9 Mon Sep 17 00:00:00 2001 From: mostafaznv Date: Wed, 25 Oct 2023 13:06:47 +0330 Subject: [PATCH] fix: source editing button causes disappearing editor #87 --- resources/js/components/editor-field.vue | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/js/components/editor-field.vue b/resources/js/components/editor-field.vue index fba1360..3533eef 100755 --- a/resources/js/components/editor-field.vue +++ b/resources/js/components/editor-field.vue @@ -96,13 +96,6 @@ export default { priority: 'lowest' }) - // set the height of the editor when editing - if (this.currentField.height > 1) { - editor.editing.view.change(writer => { - writer.setStyle('height', `${this.currentField.height}px`, editor.editing.view.document.getRoot()); - }); - } - editor.editing.view.change((writer) => { // set the height of the editor when editing if (this.currentField.height > 1) { @@ -254,7 +247,9 @@ export default { debounce((element) => { const height = element[0].target.offsetHeight - writer.setStyle('height', `${height}px`, editor.editing.view.document.getRoot()) + if (height > 10) { + writer.setStyle('height', `${height}px`, editor.editing.view.document.getRoot()) + } }, 100), )