improve functionality of cancel button
This commit is contained in:
@@ -594,8 +594,18 @@ export function SearchScreen(
|
|||||||
scrollToTopWeb()
|
scrollToTopWeb()
|
||||||
textInput.current?.blur()
|
textInput.current?.blur()
|
||||||
setShowAutocompleteResults(false)
|
setShowAutocompleteResults(false)
|
||||||
navigation.setParams({q: ''})
|
|
||||||
}, [navigation])
|
if (inputIsFocused) {
|
||||||
|
setSearchText(queryTerm)
|
||||||
|
setInputIsFocused(false)
|
||||||
|
} else {
|
||||||
|
if (isWeb) {
|
||||||
|
navigation.goBack()
|
||||||
|
} else {
|
||||||
|
navigation.setParams({q: ''})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [inputIsFocused, navigation, queryTerm])
|
||||||
|
|
||||||
const onChangeText = React.useCallback(async (text: string) => {
|
const onChangeText = React.useCallback(async (text: string) => {
|
||||||
scrollToTopWeb()
|
scrollToTopWeb()
|
||||||
|
|||||||
Reference in New Issue
Block a user