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,
|
||||
})
|
||||
}
|
||||
value={timeOptions.timePreset}
|
||||
>
|
||||
{timePresetOptions.map(({ value, description }) => (
|
||||
<option
|
||||
value={value}
|
||||
key={value}
|
||||
selected={value === timeOptions.timePreset}
|
||||
>
|
||||
<option value={value} key={value}>
|
||||
{description}
|
||||
</option>
|
||||
))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue