Skip to content

Commit

Permalink
fix: select should not ignore provided props
Browse files Browse the repository at this point in the history
Co-authored-by: Nicola Alessandro Domingo <[email protected]>
  • Loading branch information
Nick87 and Nicola Alessandro Domingo committed Apr 8, 2024
1 parent 61edd6e commit 571b334
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement
onChange: (selectedValue: string) => void;
}

export const Select = ({ id, disabled = false, label, children, onChange }: SelectProps) => {
export const Select = ({ id, disabled = false, label, children, onChange, ...rest }: SelectProps) => {
const handleChange = (e: ChangeEvent<HTMLSelectElement>) => {
onChange(e.target.value);
};

const inputProps = {
...rest,
disabled: disabled,
onChange: handleChange
};
Expand Down

0 comments on commit 571b334

Please sign in to comment.