Prevent not-equals from failing on fields that are both empty
This commit is contained in:
parent
b79b75ad78
commit
cebfcb280b
|
@ -248,7 +248,11 @@ const equalHandler = (value, rule) => {
|
||||||
|
|
||||||
// Evaluates a not equal constraint
|
// Evaluates a not equal constraint
|
||||||
const notEqualHandler = (value, rule) => {
|
const notEqualHandler = (value, rule) => {
|
||||||
return !equalHandler(value, rule)
|
const ruleValue = parseType(rule.value, rule.type)
|
||||||
|
if (value == null && ruleValue == null) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return value !== ruleValue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Evaluates a regex constraint
|
// Evaluates a regex constraint
|
||||||
|
|
Loading…
Reference in New Issue