Skip to content

Commit 02c0100

Browse files
fix: Use a select when parameter input has many options (#3762)
1 parent 01a06e1 commit 02c0100

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

site/src/components/ParameterInput/ParameterInput.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import FormControlLabel from "@material-ui/core/FormControlLabel"
2+
import MenuItem from "@material-ui/core/MenuItem"
23
import Radio from "@material-ui/core/Radio"
34
import RadioGroup from "@material-ui/core/RadioGroup"
45
import { makeStyles } from "@material-ui/core/styles"
@@ -53,23 +54,23 @@ const ParameterField: React.FC<React.PropsWithChildren<ParameterInputProps>> = (
5354
}) => {
5455
if (schema.validation_contains && schema.validation_contains.length > 0) {
5556
return (
56-
<RadioGroup
57+
<TextField
5758
id={schema.name}
59+
size="small"
5860
defaultValue={schema.default_source_value}
61+
disabled={disabled}
5962
onChange={(event) => {
6063
onChange(event.target.value)
6164
}}
65+
select
66+
fullWidth
6267
>
6368
{schema.validation_contains.map((item) => (
64-
<FormControlLabel
65-
disabled={disabled}
66-
key={item}
67-
value={item}
68-
control={<Radio color="primary" size="small" disableRipple />}
69-
label={item}
70-
/>
69+
<MenuItem key={item} value={item}>
70+
{item}
71+
</MenuItem>
7172
))}
72-
</RadioGroup>
73+
</TextField>
7374
)
7475
}
7576

0 commit comments

Comments
 (0)