diff --git a/src/renderer/src/components/right-sidebar/Search.tsx b/src/renderer/src/components/right-sidebar/Search.tsx index c62907d67..82934cfc4 100644 --- a/src/renderer/src/components/right-sidebar/Search.tsx +++ b/src/renderer/src/components/right-sidebar/Search.tsx @@ -106,9 +106,13 @@ export default function Search(): React.JSX.Element { }) }, [cancelSeededInputSelectionFrame]) - // Focus input on mount - useEffect(() => { - inputRef.current?.focus() + const setSearchInputRef = useCallback((el: HTMLInputElement | null): void => { + inputRef.current = el + // Why: focusing belongs to the input mount; the object ref still backs + // seeded-search selection and result keyboard handlers. + if (el) { + el.focus() + } }, []) // Cleanup debounce timer on unmount @@ -324,7 +328,7 @@ export default function Search(): React.JSX.Element { return (