We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 998db01 commit 4f375c9Copy full SHA for 4f375c9
src/demo/index.jsx
@@ -25,15 +25,18 @@ class Demo extends Component {
25
};
26
27
handleChange = e => {
28
- const { minLength, maxLength } = this.state;
29
let currVal = e.target.value;
30
31
- if (currVal < minLength || currVal > maxLength) {
32
- currVal = 4;
+ if (e.target.name === 'numInputs') {
+ const { minLength, maxLength } = this.state;
33
34
- console.error(
35
- `Please enter a value between ${minLength} and ${maxLength}`
36
- );
+ if (currVal < minLength || currVal > maxLength) {
+ currVal = 4;
+
+ console.error(
37
+ `Please enter a value between ${minLength} and ${maxLength}`
38
+ );
39
+ }
40
}
41
42
this.setState({ [e.target.name]: currVal });
0 commit comments