From 56b318ea382f922a0a418f8042bed778c5e194c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Mon, 3 Sep 2018 23:35:42 +0200 Subject: [PATCH] fix update event --- packages/tiptap/src/components/editor.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/tiptap/src/components/editor.js b/packages/tiptap/src/components/editor.js index 4846af63..3f136eba 100644 --- a/packages/tiptap/src/components/editor.js +++ b/packages/tiptap/src/components/editor.js @@ -204,18 +204,19 @@ export default { }, dispatchTransaction(transaction) { + this.state = this.state.apply(transaction) + this.view.updateState(this.state) + this.updateMenuActions() + if (!transaction.docChanged) { return } - - this.state = this.state.apply(transaction) - this.view.updateState(this.state) + this.$emit('update', { getHTML: this.getHTML, getJSON: this.getJSON, state: this.state, }) - this.updateMenuActions() }, getHTML() {