Browse Source
Merge pull request #6554 from Budibase/bug/sev3/blank-field-regex-not-working
Make null values empty for regex validation
master
melohagan
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
0 deletions
-
packages/client/src/components/app/forms/validation.js
|
|
|
@ -278,6 +278,9 @@ const notEqualHandler = (value, rule) => { |
|
|
|
// Evaluates a regex constraint
|
|
|
|
const regexHandler = (value, rule) => { |
|
|
|
const regex = parseType(rule.value, "string") |
|
|
|
if (!value) { |
|
|
|
value = "" |
|
|
|
} |
|
|
|
return new RegExp(regex).test(value) |
|
|
|
} |
|
|
|
|
|
|
|
|