mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-28 07:40:13 +08:00
fix: fix check for showing mention suggestion
This commit is contained in:
parent
f6ef4caa14
commit
5e652c94a7
@ -51,7 +51,11 @@ export const Mention = Node.create<MentionOptions>({
|
||||
.run()
|
||||
},
|
||||
allow: ({ editor, range }) => {
|
||||
return editor.can().insertContentAt(range, { type: 'mention' })
|
||||
const $from = editor.state.doc.resolve(range.from)
|
||||
const type = editor.schema.nodes.mention
|
||||
const allow = !!$from.parent.type.contentMatch.matchType(type)
|
||||
|
||||
return allow
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user