mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
slate-suggenstions: adding moveBackward
(#55576)
This commit is contained in:
parent
9e0d349bf9
commit
e55003174a
@ -143,6 +143,8 @@ export function SuggestionsPlugin({
|
||||
|
||||
const preserveSuffix = suggestion.kind === 'function';
|
||||
const move = suggestion.move || 0;
|
||||
const moveForward = move > 0 ? move : 0;
|
||||
const moveBackward = move < 0 ? -move : 0;
|
||||
|
||||
const { typeaheadPrefix, typeaheadText, typeaheadContext } = state;
|
||||
|
||||
@ -180,7 +182,8 @@ export function SuggestionsPlugin({
|
||||
.deleteBackward(backward)
|
||||
.deleteForward(forward)
|
||||
.insertText(suggestionText)
|
||||
.moveForward(move)
|
||||
.moveForward(moveForward)
|
||||
.moveBackward(moveBackward)
|
||||
.focus();
|
||||
|
||||
return editor;
|
||||
|
Loading…
Reference in New Issue
Block a user