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;
value: string;
className?: string;
};
@ -55,6 +57,7 @@ export function Select({
style,
className,
defaultValue,
value,
}: Props) {
return (
<>
@ -72,9 +75,10 @@ export function Select({
onMouseLeave={onMouseLeave}
style={style}
defaultValue={defaultValue}
value={value}
>
{options.map(([value, text]) => (
<option key={value} value={value}>
{options.map(([oval, text]) => (
<option key={oval} value={oval}>
{text}
</option>
))}