Skip to content

Commit

Permalink
input
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis-Riel committed Jan 29, 2023
1 parent f1ee720 commit 9792544
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion site/src/components/home/config/configItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ const ConfigItem = withStyles(configStyle)(props => {
secondary={configValue}/>}
{editing && <TextField label={name}
variant="outlined"
type={["int","float"].includes(datatype) ? "number" : "text"}
pattern={datatype === "int" ? "^[0-9]+$" : (datatype === "float" ? "^[0-9]+[.0-9]*$" : ".*")}
defaultValue={value}
onChange={event => setConfigValue(getConfigValue(event.target.value),datatype) } />}
onChange={event => setConfigValue(getConfigValue(event.target.value,datatype)) } />}
<Box className={classes.saveIcons}>
{editing && <IconButton color="primary"
aria-label="Save"
Expand Down

0 comments on commit 9792544

Please sign in to comment.