diff --git a/packages/core/src/NodeView.ts b/packages/core/src/NodeView.ts index 079c777e31..b681faf341 100644 --- a/packages/core/src/NodeView.ts +++ b/packages/core/src/NodeView.ts @@ -224,14 +224,16 @@ export class NodeView impleme } updateAttributes(attributes: {}) { - const { state } = this.editor.view - const pos = this.getPos() - const transaction = state.tr.setNodeMarkup(pos, undefined, { - ...this.node.attrs, - ...attributes, - }) + this.editor.commands.command(({ tr }) => { + const pos = this.getPos() + + tr.setNodeMarkup(pos, undefined, { + ...this.node.attrs, + ...attributes, + }) - this.editor.view.dispatch(transaction) + return true + }) } deleteNode(): void {