Skip to content

Commit 09a3d12

Browse files
Fix "minimum-length" option of the "validate-length" JS validation
The `minimum-length` options was incorrectly used because the value _had to be empty_ first in order to be checked, and that's illogical.
1 parent a89acbb commit 09a3d12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/web/mage/validation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@
11391139
validator.attrLength = length;
11401140
result = (v.length <= length);
11411141
}
1142-
if (name.match(reMin) && result && $.mage.isEmpty(v)) {
1142+
if (name.match(reMin) && result && !$.mage.isEmpty(v)) {
11431143
length = name.split('-')[2];
11441144
result = v.length >= length;
11451145
}

0 commit comments

Comments
 (0)