mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
fix(frontend): improper usage of select element
The <select> element must receive the current value through the `value` prop and not by setting `selected` on the current option. Reference: https://reactjs.org/docs/forms.html#the-select-tag
This commit is contained in:
parent
1e674d18c9
commit
a139f7b25b
1 changed files with 2 additions and 5 deletions
|
|
@ -34,13 +34,10 @@ export const ReportTimeOptions: React.FC<ReportTimeOptionsProps> = ({
|
||||||
timePreset: e.target.value as TimePreset,
|
timePreset: e.target.value as TimePreset,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
value={timeOptions.timePreset}
|
||||||
>
|
>
|
||||||
{timePresetOptions.map(({ value, description }) => (
|
{timePresetOptions.map(({ value, description }) => (
|
||||||
<option
|
<option value={value} key={value}>
|
||||||
value={value}
|
|
||||||
key={value}
|
|
||||||
selected={value === timeOptions.timePreset}
|
|
||||||
>
|
|
||||||
{description}
|
{description}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue