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 b79b75ad78
commit cebfcb280b
1 changed files with 5 additions and 1 deletions

View File

@ -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