fix(webui): focus restored drafts before setting mention selection
This commit is contained in:
1 parent
78ae5ff94f
commit
3a14935eb1
2 files changed
+14
-2
No files matched your search
@@ -44,7 +44,10 @@ export function useComposerMentionInput({
|
||||
}, [inputRef]);
|
||||
|
||||
const selectRaw = useCallback((start: number, end = start) => {
|
||||
inputRef.current?.setSelectionRange(
|
||||
const el = inputRef.current;
|
||||
// Focus first: removing a queued prompt's edit button can reset a blurred selection.
|
||||
el?.focus();
|
||||
el?.setSelectionRange(
|
||||
mentionTextOffset(textRef.current, start, "toDisplay", "start"),
|
||||
mentionTextOffset(textRef.current, end, "toDisplay", "end"),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user