Update select props

This commit is contained in:
Hazem Krimi
2021-04-28 21:31:18 +01:00
parent 90972144ab
commit 7e71eab533
+3 -1
View File
@@ -21,6 +21,7 @@ type SelectProps = {
label?: string; label?: string;
fullWidth?: boolean; fullWidth?: boolean;
onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void; onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
onBlur?: (event: React.FocusEvent<HTMLSelectElement>) => void;
}; };
const Select = ({ const Select = ({
@@ -30,6 +31,7 @@ const Select = ({
value, value,
options, options,
onChange, onChange,
onBlur,
error, error,
errorMessage, errorMessage,
...props ...props
@@ -50,7 +52,7 @@ const Select = ({
</div> </div>
<div className='select'> <div className='select'>
<div> <div>
<select value={value} name={name} onChange={onChange}> <select value={value} name={name} onChange={onChange} onBlur={onBlur}>
{options.map((option) => ( {options.map((option) => (
<option key={value} value={option.value}> <option key={value} value={option.value}>
{option.label} {option.label}