Skip to content

Commit

Permalink
clear search on tab press (#3753)
Browse files Browse the repository at this point in the history
* clear search on tab press

* don't need to call `onPressCancelSearch`
  • Loading branch information
haileyok authored Apr 29, 2024
1 parent 5d715ae commit 2feea51
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/view/screens/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 2feea51

Please sign in to comment.