refactoring
This commit is contained in:
@@ -48,8 +48,8 @@ export default class MentionNode extends Node {
|
||||
allowSpaces: false,
|
||||
startOfLine: false,
|
||||
},
|
||||
command: ({ position, attrs, schema }) => {
|
||||
return replaceText(position, schema.nodes.mention, attrs)
|
||||
command: ({ range, attrs, schema }) => {
|
||||
return replaceText(range, schema.nodes.mention, attrs)
|
||||
},
|
||||
items: this.options.items,
|
||||
onEnter: this.options.onEnter,
|
||||
|
||||
@@ -146,9 +146,9 @@ export default function SuggestionsPlugin({
|
||||
decorationNode,
|
||||
virtualNode,
|
||||
items: onFilter(items, next.text),
|
||||
command: ({ position, attrs }) => {
|
||||
command: ({ replaceRange, attrs }) => {
|
||||
command({
|
||||
position,
|
||||
range: replaceRange,
|
||||
attrs,
|
||||
schema: view.state.schema,
|
||||
})(view.state, view.dispatch, view)
|
||||
|
||||
Reference in New Issue
Block a user