Skip to content

Commit

Permalink
feat: add selected values list to select change event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
abelflopes committed Jul 4, 2024
1 parent 41be079 commit 963ac5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/components/select/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ const Select = ({
multiple={selectMultiple}
defaultValue={defaultValue}
value={internalValue}
onChange={selectOnChange}>
onChange={(e) => {
selectOnChange?.(e, selectedValuesList);
}}>
{selectedValuesList.map((i) => (
<option key={i} value={i}>
{i}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/select/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface SelectProps
placeholder: string;
emptyStateMessage: (value: string) => React.ReactNode;
};
onChange?: React.SelectHTMLAttributes<HTMLSelectElement>["onChange"];
onChange?: (e: React.ChangeEvent<HTMLSelectElement>, selectedValues: SelectedValues) => void;
value?: UserValue;
defaultValue?: UserValue;
name?: React.SelectHTMLAttributes<HTMLSelectElement>["name"];
Expand Down

0 comments on commit 963ac5f

Please sign in to comment.