Material UI version: "@mui/material": "^5.15.15",
Here’s the snippet code
<TextField
className="input-quantity form-input"
defaultValue={0}
name={"quantity"}
type="number"
InputProps={{
inputProps: {
min: 0,
max: 100,
},
}}
onChange={(event: any) =>
handleChange(e)
}
/>
the input still can pass over 100, even to thousand value.
this happened to text type too as the inputProps used maxLength
2
Answers
InputProps properties are handled in Material-UI’s component.
Users can still enter values outside the specified range
You can try something like that: