Skip to content

How can I manually destroy a node view? #1317

Discussion options

You must be logged in to vote

You have to calculate the range of your node view. After that you can use the deleteRange command.

// get some node view props
// depends on your setup (vue, react)
const { editor, getPos, node } = this

const from = getPos()
const to = from + node.nodeSize

editor.commands.deleteRange({ from, to })

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@dkrusenstrahle
Comment options

@philippkuehn
Comment options

Answer selected by dkrusenstrahle
Comment options

You must be logged in to vote
3 replies
@peiris
Comment options

@bpospanov
Comment options

@SergkeiM
Comment options

Comment options

You must be logged in to vote
1 reply
@paduc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants