From 2feea51ae36bee5ae60030b104e7f5300ce4736a Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 29 Apr 2024 09:32:20 -0700 Subject: [PATCH] clear search on tab press (#3753) * clear search on tab press * don't need to call `onPressCancelSearch` --- src/view/screens/Search/Search.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index 2335549af2..9e34067fb8 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -599,9 +599,14 @@ export function SearchScreen( ) const onSoftReset = React.useCallback(() => { - scrollToTopWeb() - onPressCancelSearch() - }, [onPressCancelSearch]) + if (isWeb) { + // Empty params resets the URL to be /search rather than /search?q= + navigation.replace('Search', {}) + } else { + setSearchText('') + navigation.setParams({q: ''}) + } + }, [navigation]) useFocusEffect( React.useCallback(() => {