clear search on tab press (#3753)

* clear search on tab press

* don't need to call `onPressCancelSearch`
zio/stable
Hailey 2024-04-29 09:32:20 -07:00 committed by GitHub
parent 5d715ae1d0
commit 2feea51ae3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 3 deletions

View File

@ -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(() => {