aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/components/SelectField.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/common/components/SelectField.jsx')
-rw-r--r--modern/src/common/components/SelectField.jsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/modern/src/common/components/SelectField.jsx b/modern/src/common/components/SelectField.jsx
index c7efe75f..db8c30b0 100644
--- a/modern/src/common/components/SelectField.jsx
+++ b/modern/src/common/components/SelectField.jsx
@@ -1,5 +1,5 @@
import {
- FormControl, InputLabel, MenuItem, Select, Autocomplete, TextField
+ FormControl, InputLabel, MenuItem, Select, Autocomplete, TextField,
} from '@mui/material';
import React, { useState } from 'react';
import { useEffectAsync } from '../../reactHelper';
@@ -21,10 +21,10 @@ const SelectField = ({
const getOptionLabel = (option) => {
if (typeof option !== 'object') {
- option = items.find(obj => keyGetter(obj) === option);
+ option = items.find((obj) => keyGetter(obj) === option);
}
return option ? titleGetter(option) : emptyTitle;
- }
+ };
useEffectAsync(async () => {
if (endpoint) {
@@ -62,9 +62,9 @@ const SelectField = ({
renderOption={(props, option) => (
<MenuItem {...props} key={keyGetter(option)} value={keyGetter(option)}>{titleGetter(option)}</MenuItem>
)}
- isOptionEqualToValue={(option, value) => keyGetter(option) == value}
+ isOptionEqualToValue={(option, value) => keyGetter(option) === value}
value={value}
- onChange={(_, value) => onChange({ target: { value: value ? keyGetter(value) : emptyValue }})}
+ onChange={(_, value) => onChange({ target: { value: value ? keyGetter(value) : emptyValue } })}
renderInput={(params) => <TextField {...params} label={label} />}
/>
)}