Skip to content

Commit

Permalink
Call onSelect on value change
Browse files Browse the repository at this point in the history
  • Loading branch information
vineethasok committed Sep 18, 2023
1 parent 9971194 commit c1ecdba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Combobox/ComboboxProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ export const ComboboxProvider = ({
(value: SetStateAction<Array<string>>) => {
setSelectedValues(values => {
const newValue = typeof value === "function" ? value(values) : value;

onSelectProp(newValue);
if (inputRef.current) {
inputRef.current.value = newValue.join(",");
}
return newValue;
});
},
[inputRef]
[inputRef, onSelectProp]
);

useEffect(() => {
Expand Down

0 comments on commit c1ecdba

Please sign in to comment.