fix: machine status popup validation now occurs only on lose of focus
This commit is contained in:
parent
8a8503dcbb
commit
d88508d0f5
1 changed files with 3 additions and 1 deletions
|
|
@ -66,6 +66,7 @@ export const ConfirmDialog = memo(
|
|||
}) => {
|
||||
const classes = useStyles()
|
||||
const [value, setValue] = useState('')
|
||||
const [error, setError] = useState(false)
|
||||
useEffect(() => setValue(''), [open])
|
||||
const handleChange = event => {
|
||||
setValue(event.target.value)
|
||||
|
|
@ -92,9 +93,10 @@ export const ConfirmDialog = memo(
|
|||
fullWidth
|
||||
value={value}
|
||||
touched={{}}
|
||||
error={toBeConfirmed !== value}
|
||||
error={error}
|
||||
InputLabelProps={{ shrink: true, className: classes.label }}
|
||||
onChange={handleChange}
|
||||
onBlur={() => setError(toBeConfirmed !== value)}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions classes={{ spacing: classes.spacing }}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue