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(() => {
|
const onSoftReset = React.useCallback(() => {
|
||||||
scrollToTopWeb()
|
if (isWeb) {
|
||||||
onPressCancelSearch()
|
// Empty params resets the URL to be /search rather than /search?q=
|
||||||
}, [onPressCancelSearch])
|
navigation.replace('Search', {})
|
||||||
|
} else {
|
||||||
|
setSearchText('')
|
||||||
|
navigation.setParams({q: ''})
|
||||||
|
}
|
||||||
|
}, [navigation])
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
React.useCallback(() => {
|
React.useCallback(() => {
|
||||||
|
|
Loading…
Reference in New Issue