fix: reset selected index on input change

This commit is contained in:
codytseng
2025-09-23 22:04:00 +08:00
parent 5ef08b933e
commit ac007acbd7

View File

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