Skip to content

Commit

Permalink
fix(editor): only setEditable when needed
Browse files Browse the repository at this point in the history
This will trigger an update event on the editor
which in turn will trigger all update handlers.

Avoid this when not necessary.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Jun 17, 2024
1 parent 7520a02 commit 6015463
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,10 @@ export default {
this.document = document
this.syncError = null
this.$editor.setEditable(!this.readOnly)
const editable = !this.readOnly
if (this.$editor.isEditable !== editable) {
this.$editor.setEditable(editable)
}
},
onSync({ steps, document }) {
Expand Down

0 comments on commit 6015463

Please sign in to comment.