我有以下输入字段,我希望它只接受正整数,而不能插入字符 - + , .
。
<TextField
fullWidth
type="number"
placeholder={'[1-100]'}
id="simple-start-adornmhent"
onChange={this.handleChangeField('amount')}
InputProps={{ inputProps: { min: 1 } }}
/>
你能给我一些建议吗?
最佳答案
试试这个
<TextField type="number"
label="Short stop treshold"
InputProps={{
inputProps: { min: 0 }
}}
value={10}
onChange={handleShortStopChange} />
关于javascript - ReactJS Material -UI : Accept only positive unsigned integer values in TextField,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57269224/