Use value attribute for select

This commit is contained in:
Arnaud 2024-09-20 11:03:34 +02:00
parent 587936ddb9
commit 7456a770f9
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
1 changed files with 6 additions and 2 deletions

View File

@ -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>
))} ))}