fix: Check node type above custom update function for node views (#2081)
This commit is contained in:
@@ -114,6 +114,10 @@ class ReactNodeView extends NodeView<React.FunctionComponent, Editor, ReactNodeV
|
|||||||
this.renderer.updateProps(props)
|
this.renderer.updateProps(props)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.type !== this.node.type) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof this.options.update === 'function') {
|
if (typeof this.options.update === 'function') {
|
||||||
const oldNode = this.node
|
const oldNode = this.node
|
||||||
const oldDecorations = this.decorations
|
const oldDecorations = this.decorations
|
||||||
@@ -130,10 +134,6 @@ class ReactNodeView extends NodeView<React.FunctionComponent, Editor, ReactNodeV
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.type !== this.node.type) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node === this.node && this.decorations === decorations) {
|
if (node === this.node && this.decorations === decorations) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user