From 2d411d71fea49597d64fc3489c78b846ab8404d1 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 7 Apr 2026 14:35:16 -0500 Subject: [PATCH] Widen ref type, add back hotkey --- src/components/forms/SearchInput.tsx | 10 +++++----- src/view/shell/desktop/Search.tsx | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/forms/SearchInput.tsx b/src/components/forms/SearchInput.tsx index 8b54b44246..edd737352f 100644 --- a/src/components/forms/SearchInput.tsx +++ b/src/components/forms/SearchInput.tsx @@ -3,6 +3,7 @@ import {type TextInput, View} from 'react-native' import {useLingui} from '@lingui/react/macro' import {HITSLOP_10} from '#/lib/constants' +import {mergeRefs} from '#/lib/merge-refs' import {listenFocusSearch} from '#/state/events' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonIcon} from '#/components/Button' @@ -18,7 +19,7 @@ type Props = Omit & { */ onClearText?: () => void hotkey?: boolean - ref?: React.RefObject + ref?: React.Ref } export function SearchInput({ @@ -33,21 +34,20 @@ export function SearchInput({ const {t: l} = useLingui() const showClear = value && value.length > 0 const internalRef = useRef(null) - const inputRef = ref ?? internalRef useEffect(() => { if (!hotkey) return return listenFocusSearch(() => { - inputRef.current?.focus() + internalRef.current?.focus() }) - }, [hotkey, inputRef]) + }, [hotkey]) return (