mirror of
https://github.com/woodchen-ink/CoverView.git
synced 2025-07-18 14:01:56 +08:00
border max value changed to 50, also maxBorderValidationCheck() function added to prevent user to type value >than 50
This commit is contained in:
parent
86f1de9f23
commit
931b5e2de4
@ -41,7 +41,12 @@ class ConfigCover extends React.Component {
|
|||||||
getRandomTheme = (theme, Pattern) => {
|
getRandomTheme = (theme, Pattern) => {
|
||||||
this.setState({ bgColor: theme.bgColor, borderColor: theme.bdColor, pattern: 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() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="main-container">
|
<div className="main-container">
|
||||||
@ -118,7 +123,7 @@ class ConfigCover extends React.Component {
|
|||||||
<div className="d-flex flex-row">
|
<div className="d-flex flex-row">
|
||||||
<div className="input-sm">
|
<div className="input-sm">
|
||||||
<label>Size</label>
|
<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>
|
||||||
|
|
||||||
<div className="input-sm">
|
<div className="input-sm">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user