aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
authorMatjaž Črnko <m.crnko@txt.si>2024-01-23 16:25:31 +0100
committerMatjaž Črnko <m.crnko@txt.si>2024-01-23 16:25:31 +0100
commit7fe52f39c7ccd1e7bfeb07b1480b9b25a08226ab (patch)
tree07627dd03cd93f5c81f2b0d450dc66dab8b69984 /modern
parentba24d834925f3d66d875ae601e80a60cf03110cc (diff)
downloadtrackermap-web-7fe52f39c7ccd1e7bfeb07b1480b9b25a08226ab.tar.gz
trackermap-web-7fe52f39c7ccd1e7bfeb07b1480b9b25a08226ab.tar.bz2
trackermap-web-7fe52f39c7ccd1e7bfeb07b1480b9b25a08226ab.zip
fix: SelectField code style cleanup
Diffstat (limited to 'modern')
-rw-r--r--modern/src/common/components/SelectField.jsx26
1 files changed, 12 insertions, 14 deletions
diff --git a/modern/src/common/components/SelectField.jsx b/modern/src/common/components/SelectField.jsx
index 52ec591b..ee512a78 100644
--- a/modern/src/common/components/SelectField.jsx
+++ b/modern/src/common/components/SelectField.jsx
@@ -55,20 +55,18 @@ const SelectField = ({
</Select>
</>
) : (
- <>
- <Autocomplete
- size="small"
- options={items}
- getOptionLabel={getOptionLabel}
- renderOption={(props, option) => (
- <MenuItem {...props} key={keyGetter(option)} value={keyGetter(option)}>{titleGetter(option)}</MenuItem>
- )}
- isOptionEqualToValue={(option, value) => keyGetter(option) == value}
- value={value}
- onChange={(e, nV) => {onChange({target:{value:nV ? keyGetter(nV) : emptyValue}})}}
- renderInput={(params) => <TextField {...params} label={label} />}
- />
- </>
+ <Autocomplete
+ size="small"
+ options={items}
+ getOptionLabel={getOptionLabel}
+ renderOption={(props, option) => (
+ <MenuItem {...props} key={keyGetter(option)} value={keyGetter(option)}>{titleGetter(option)}</MenuItem>
+ )}
+ isOptionEqualToValue={(option, value) => keyGetter(option) == value}
+ value={value}
+ onChange={(_, value) => {onChange({ target: { value: value ? keyGetter(value) : emptyValue }})}}
+ renderInput={(params) => <TextField {...params} label={label} />}
+ />
)}
</FormControl>
);