Merge pull request #6554 from Budibase/bug/sev3/blank-field-regex-not-working
Make null values empty for regex validation
This commit is contained in:
commit
d2ffd68ebf
|
@ -278,6 +278,9 @@ const notEqualHandler = (value, rule) => {
|
||||||
// Evaluates a regex constraint
|
// Evaluates a regex constraint
|
||||||
const regexHandler = (value, rule) => {
|
const regexHandler = (value, rule) => {
|
||||||
const regex = parseType(rule.value, "string")
|
const regex = parseType(rule.value, "string")
|
||||||
|
if (!value) {
|
||||||
|
value = ""
|
||||||
|
}
|
||||||
return new RegExp(regex).test(value)
|
return new RegExp(regex).test(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue