allow functions for items in mention node
This commit is contained in:
@@ -63,7 +63,7 @@ export default {
|
||||
new HeadingNode({ maxLevel: 3 }),
|
||||
new MentionNode({
|
||||
// a list of all suggested items
|
||||
items: [
|
||||
items: () => [
|
||||
{ id: 1, name: 'Philipp Kühn' },
|
||||
{ id: 2, name: 'Hans Pagel' },
|
||||
{ id: 3, name: 'Kris Siepert' },
|
||||
|
||||
@@ -127,7 +127,7 @@ export default function SuggestionsPlugin({
|
||||
text: state.text,
|
||||
decorationNode,
|
||||
virtualNode,
|
||||
items: onFilter(items, state.query),
|
||||
items: onFilter(Array.isArray(items) ? items : items(), state.query),
|
||||
command: ({ range, attrs }) => {
|
||||
command({
|
||||
range,
|
||||
|
||||
Reference in New Issue
Block a user