From b76d3f50df799029cb7d7d4bc76b76c2285d98ab Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 18 Dec 2022 00:41:49 +0100 Subject: [PATCH] Make search transition smoother? --- src/screens/Tabs/Shared/Search/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/screens/Tabs/Shared/Search/index.tsx b/src/screens/Tabs/Shared/Search/index.tsx index 9c70098b..f31a3e14 100644 --- a/src/screens/Tabs/Shared/Search/index.tsx +++ b/src/screens/Tabs/Shared/Search/index.tsx @@ -49,7 +49,6 @@ const TabSharedSearch: React.FC> > borderBottomColor: colors.border, borderBottomWidth: 1 }} - autoFocus onChangeText={debounce( text => { setSearchTerm(text) @@ -82,6 +80,13 @@ const TabSharedSearch: React.FC> } }) }, [mode]) + useEffect(() => { + const unsubscribe = navigation.addListener('transitionEnd', e => { + inputRef.current?.focus() + }) + + return unsubscribe + }, [navigation]) const mapKeyToTranslations = { accounts: t('shared.search.sections.accounts'),