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:
Julian Tölle 2020-11-07 19:23:37 +01:00
parent 1e674d18c9
commit a139f7b25b

View file

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