border max value changed to 50, also maxBorderValidationCheck() function added to prevent user to type value >than 50

This commit is contained in:
Rajakumardev 2020-10-07 18:49:33 +05:30
parent 86f1de9f23
commit 931b5e2de4

View File

@ -41,7 +41,12 @@ class ConfigCover extends React.Component {
getRandomTheme = (theme, Pattern) => {
this.setState({ bgColor: theme.bgColor, borderColor: theme.bdColor, pattern: Pattern });
}
//this function will set the max border value to 50 if user types a value greater than 50
maxBorderValidationCheck = (e) => {
if(e.target.value > 50) {
e.target.value = 50;
}
}
render() {
return (
<div className="main-container">
@ -118,7 +123,7 @@ class ConfigCover extends React.Component {
<div className="d-flex flex-row">
<div className="input-sm">
<label>Size</label>
<input type="number" max="200" className="form-control " value={this.state.borderSize} onChange={(e) => this.setState({ borderSize: e.target.value })} />
<input type="number" max="50" onInput = {this.maxBorderValidationCheck} className="form-control " value={this.state.borderSize} onChange={(e) => this.setState({ borderSize: e.target.value })} />
</div>
<div className="input-sm">