remove need to set query to '' on clear

This commit is contained in:
Samuel Newman
2024-10-09 07:31:39 +03:00
parent 8a605d807f
commit 130edab331
2 changed files with 2 additions and 3 deletions
-1
View File
@@ -667,7 +667,6 @@ export function SearchScreen(
const onPressClearQuery = React.useCallback(() => {
scrollToTopWeb()
setSearchText('')
textInput.current?.focus()
}, [])
+2 -2
View File
@@ -166,9 +166,8 @@ export function DesktopSearch() {
}, [])
const onPressCancelSearch = React.useCallback(() => {
setQuery('')
setIsActive(false)
}, [setQuery])
}, [])
const onSubmit = React.useCallback(() => {
setIsActive(false)
@@ -184,6 +183,7 @@ export function DesktopSearch() {
return (
<View style={[styles.container, pal.view]}>
<SearchInput
// web only, so fine to be controlled
value={query}
onChangeText={onChangeText}
onClearText={onPressCancelSearch}