Skip to content

Commit

Permalink
Merge pull request #265 from gbermudez1992/main
Browse files Browse the repository at this point in the history
fix set focused value when first item changes
  • Loading branch information
Kysluss authored Aug 14, 2024
2 parents 04b150a + 6ab8462 commit e61f77e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/use-autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function useAutoComplete(
useUpdateEffect(() => {
if (prefocusFirstItem)
setFocusedValue(firstItem?.value);
}, [query, firstItem]);
}, [query, firstItem?.value]);

useEffect(() => {
if (!isOpen && prefocusFirstItem)
Expand Down

0 comments on commit e61f77e

Please sign in to comment.