feat: add ignoreMutation option to NodeViewRenderer, fix #1538
This commit is contained in:
@@ -25,6 +25,7 @@ export class NodeView<Component, Editor extends CoreEditor = CoreEditor> impleme
|
||||
options: NodeViewRendererOptions = {
|
||||
stopEvent: null,
|
||||
update: null,
|
||||
ignoreMutation: null,
|
||||
}
|
||||
|
||||
constructor(component: Component, props: NodeViewRendererProps, options?: Partial<NodeViewRendererOptions>) {
|
||||
@@ -176,6 +177,10 @@ export class NodeView<Component, Editor extends CoreEditor = CoreEditor> impleme
|
||||
return true
|
||||
}
|
||||
|
||||
if (typeof this.options.ignoreMutation === 'function') {
|
||||
return this.options.ignoreMutation(mutation)
|
||||
}
|
||||
|
||||
// a leaf/atom node is like a black box for ProseMirror
|
||||
// and should be fully handled by the node view
|
||||
if (this.node.isLeaf || this.node.isAtom) {
|
||||
|
||||
Reference in New Issue
Block a user