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) {
onSearch(null)
}
setSelectedIndex(-1)
}, [input])
useEffect(() => {