We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a6d8c5b + de2cbc5 commit 3952e32Copy full SHA for 3952e32
index.js
@@ -50,6 +50,9 @@ export default class ValidationComponent extends Component {
50
51
// Method to check rules on a spefific field
52
_checkRules(fieldName, rules, value) {
53
+ if (!value && !rules.required ) {
54
+ return; // if value is empty AND its not required by the rules, no need to check any other rules
55
+ }
56
for (const key of Object.keys(rules)) {
57
const isRuleFn = (typeof this.rules[key] == "function");
58
const isRegExp = (this.rules[key] instanceof RegExp);
0 commit comments