fix: RangeError: Position -1 out of range
This commit is contained in:
@@ -186,9 +186,12 @@ function SuggestionsMenu<T extends MenuItem>(props: Props<T>) {
|
|||||||
dispatch(
|
dispatch(
|
||||||
state.tr.insertText(
|
state.tr.insertText(
|
||||||
"",
|
"",
|
||||||
state.selection.from -
|
Math.max(
|
||||||
(props.search ?? "").length -
|
0,
|
||||||
(trimTrigger ? props.trigger.length : 0),
|
state.selection.from -
|
||||||
|
(props.search ?? "").length -
|
||||||
|
(trimTrigger ? props.trigger.length : 0)
|
||||||
|
),
|
||||||
state.selection.to
|
state.selection.to
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user