Prevent not-equals from failing on fields that are both empty

This commit is contained in:
Andrew Kingston 2021-08-11 14:59:12 +01:00
parent 48059f6096
commit a3629ce68c
1 changed files with 5 additions and 1 deletions

View File

@ -248,7 +248,11 @@ const equalHandler = (value, rule) => {
// Evaluates a not equal constraint
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