Browse Source

fix: reset selected index on input change

imwald
codytseng 6 months ago
parent
commit
ac007acbd7
  1. 1
      src/components/SearchBar/index.tsx

1
src/components/SearchBar/index.tsx

@ -66,6 +66,7 @@ const SearchBar = forwardRef<
if (!input) { if (!input) {
onSearch(null) onSearch(null)
} }
setSelectedIndex(-1)
}, [input]) }, [input])
useEffect(() => { useEffect(() => {

Loading…
Cancel
Save