Skip to content

Commit

Permalink
Add consoleLog and wait for next tick
Browse files Browse the repository at this point in the history
  • Loading branch information
allanbenelli committed Apr 18, 2024
1 parent 6aa8f8c commit 1c7cc25
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions resources/js/components/feedback/FeedbackEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c7cc25

Please sign in to comment.