clear search on tab press (#3753)
* clear search on tab press * don't need to call `onPressCancelSearch`zio/stable
parent
5d715ae1d0
commit
2feea51ae3
|
@ -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(() => {
|
||||
|
|
Loading…
Reference in New Issue