Use value attribute for select
This commit is contained in:
parent
587936ddb9
commit
7456a770f9
|
@ -40,6 +40,8 @@ type Props = {
|
||||||
|
|
||||||
defaultValue?: string;
|
defaultValue?: string;
|
||||||
|
|
||||||
|
value: string;
|
||||||
|
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,6 +57,7 @@ export function Select({
|
||||||
style,
|
style,
|
||||||
className,
|
className,
|
||||||
defaultValue,
|
defaultValue,
|
||||||
|
value,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -72,9 +75,10 @@ export function Select({
|
||||||
onMouseLeave={onMouseLeave}
|
onMouseLeave={onMouseLeave}
|
||||||
style={style}
|
style={style}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
|
value={value}
|
||||||
>
|
>
|
||||||
{options.map(([value, text]) => (
|
{options.map(([oval, text]) => (
|
||||||
<option key={value} value={value}>
|
<option key={oval} value={oval}>
|
||||||
{text}
|
{text}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
|
Loading…
Reference in New Issue