Skip to content

Commit

Permalink
fix(autocomplete): maximum update depth exceeded in autocomplete (#3175)
Browse files Browse the repository at this point in the history
  • Loading branch information
wingkwong authored Jun 4, 2024
1 parent f3fdb7b commit 2069a7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tough-peaches-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/autocomplete": patch
---

Fix maximum update depth exceeded on Autocomplete component (#3094)
2 changes: 1 addition & 1 deletion packages/components/autocomplete/src/use-autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export function useAutocomplete<T extends object>(originalProps: UseAutocomplete
state.setSelectedKey(key);
state.setInputValue(item.textValue);
}
}, [inputRef.current, state]);
}, [inputRef.current]);

// apply the same with to the popover as the select
useEffect(() => {
Expand Down

0 comments on commit 2069a7a

Please sign in to comment.