mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-11 11:45:15 +08:00
fix: Check node type above custom update function for node views (#2081)
This commit is contained in:
parent
45778b81dd
commit
ddc9ca8d4f
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user