wording
This commit is contained in:
@@ -184,7 +184,7 @@ export default {
|
|||||||
// so it's important to pass also the position of your suggestion text
|
// so it's important to pass also the position of your suggestion text
|
||||||
selectUser(user) {
|
selectUser(user) {
|
||||||
this.insertMention({
|
this.insertMention({
|
||||||
replaceRange: this.suggestionRange,
|
range: this.suggestionRange,
|
||||||
attrs: {
|
attrs: {
|
||||||
id: user.id,
|
id: user.id,
|
||||||
label: user.name,
|
label: user.name,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export default function (pos, type, attrs = {}) {
|
export default function (range, type, attrs = {}) {
|
||||||
return (state, dispatch) => {
|
return (state, dispatch) => {
|
||||||
const { $from } = state.selection
|
const { $from } = state.selection
|
||||||
const index = $from.index()
|
const index = $from.index()
|
||||||
@@ -8,7 +8,7 @@ export default function (pos, type, attrs = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dispatch) {
|
if (dispatch) {
|
||||||
dispatch(state.tr.replaceWith(pos.from, pos.to, type.create(attrs)))
|
dispatch(state.tr.replaceWith(range.from, range.to, type.create(attrs)))
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -146,9 +146,9 @@ export default function SuggestionsPlugin({
|
|||||||
decorationNode,
|
decorationNode,
|
||||||
virtualNode,
|
virtualNode,
|
||||||
items: onFilter(items, next.text),
|
items: onFilter(items, next.text),
|
||||||
command: ({ replaceRange, attrs }) => {
|
command: ({ range, attrs }) => {
|
||||||
command({
|
command({
|
||||||
range: replaceRange,
|
range,
|
||||||
attrs,
|
attrs,
|
||||||
schema: view.state.schema,
|
schema: view.state.schema,
|
||||||
})(view.state, view.dispatch, view)
|
})(view.state, view.dispatch, view)
|
||||||
|
|||||||
Reference in New Issue
Block a user