From 1c7cc253b8e50b5c4de635f1f3b950c7ac491afc Mon Sep 17 00:00:00 2001 From: Allan Benelli Date: Thu, 18 Apr 2024 15:12:55 +0200 Subject: [PATCH] Add consoleLog and wait for next tick --- resources/js/components/feedback/FeedbackEditor.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/js/components/feedback/FeedbackEditor.vue b/resources/js/components/feedback/FeedbackEditor.vue index 9030e246..600be82e 100644 --- a/resources/js/components/feedback/FeedbackEditor.vue +++ b/resources/js/components/feedback/FeedbackEditor.vue @@ -80,11 +80,21 @@ export default { }, onCreate: ({ editor }) => { let creating = true + + // Ensure editor is fully loaded before setting creating to false + editor.on('transaction', () => { + if (creating) { + this.$nextTick(() => {creating = false;}); + } + }); editor.on('update', ({editor, transaction}) => { + console.log('onUpdate bool creating:', creating) this.currentValue = editor.getJSON() this.$emit('input', this.currentValue) // onUpdate is also called while creating the editor, so filter that call out if (!this.isRemoteChange(transaction) && !creating) { + console.log('onUpdate bool creating:', creating) + this.$emit('localinput', this.currentValue) } creating = false