change search cancel behaviour (#7624)
This commit is contained in:
@@ -741,8 +741,14 @@ export function SearchScreen(
|
|||||||
scrollToTopWeb()
|
scrollToTopWeb()
|
||||||
textInput.current?.blur()
|
textInput.current?.blur()
|
||||||
setShowAutocomplete(false)
|
setShowAutocomplete(false)
|
||||||
setSearchText(queryParam)
|
if (isWeb) {
|
||||||
}, [setShowAutocomplete, setSearchText, queryParam])
|
// Empty params resets the URL to be /search rather than /search?q=
|
||||||
|
navigation.replace('Search', {})
|
||||||
|
} else {
|
||||||
|
setSearchText('')
|
||||||
|
navigation.setParams({q: ''})
|
||||||
|
}
|
||||||
|
}, [setShowAutocomplete, setSearchText, navigation])
|
||||||
|
|
||||||
const onSubmit = React.useCallback(() => {
|
const onSubmit = React.useCallback(() => {
|
||||||
navigateToItem(searchText)
|
navigateToItem(searchText)
|
||||||
|
|||||||
Reference in New Issue
Block a user