remove replaceRange from mention node

This commit is contained in:
Philipp Kühn
2021-05-05 13:49:32 +02:00
parent ec838a11f2
commit 63902d4bdb
2 changed files with 7 additions and 4 deletions

View File

@@ -17,12 +17,15 @@ export const Mention = Node.create<MentionOptions>({
editor
.chain()
.focus()
.replaceRange(range, 'mention', props)
.insertContentAt(range, {
type: 'mention',
attrs: props,
})
.insertContent(' ')
.run()
},
allow: ({ editor, range }) => {
return editor.can().replaceRange(range, 'mention')
return editor.can().insertContentAt(range, { type: 'mention' })
},
},
},