remove need to set query to '' on clear
This commit is contained in:
@@ -667,7 +667,6 @@ export function SearchScreen(
|
||||
|
||||
const onPressClearQuery = React.useCallback(() => {
|
||||
scrollToTopWeb()
|
||||
setSearchText('')
|
||||
textInput.current?.focus()
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user