File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
apps/OpenSign/src/components/pdf Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ function PlaceholderType(props) {
38
38
"December"
39
39
] ;
40
40
const validateExpression = ( regexValidation ) => {
41
- if ( textValue ) {
41
+ if ( textValue && regexValidation ) {
42
42
let regexObject = regexValidation ;
43
43
if ( props . pos ?. options ?. validation ?. type === "regex" ) {
44
44
regexObject = RegexParser ( regexValidation ) ;
@@ -56,7 +56,7 @@ function PlaceholderType(props) {
56
56
props . setDraggingEnabled ( true ) ;
57
57
const validateType = props . pos ?. options ?. validation ?. type ;
58
58
let regexValidation ;
59
- if ( validateType ) {
59
+ if ( validateType && validateType !== "text" ) {
60
60
switch ( validateType ) {
61
61
case "email" :
62
62
regexValidation = / ^ [ a - z A - Z 0 - 9 . _ - ] + @ [ a - z A - Z 0 - 9 . - ] + \. [ a - z A - Z ] { 2 , } $ / ;
@@ -66,12 +66,8 @@ function PlaceholderType(props) {
66
66
regexValidation = / ^ [ 0 - 9 \s ] * $ / ;
67
67
validateExpression ( regexValidation ) ;
68
68
break ;
69
- case "text" :
70
- regexValidation = / ^ [ a - z A - Z \s ] + $ / ;
71
- validateExpression ( regexValidation ) ;
72
- break ;
73
69
default :
74
- regexValidation = props . pos ?. options . validation . pattern ;
70
+ regexValidation = props . pos ?. options ? .validation ? .pattern || "" ;
75
71
validateExpression ( regexValidation ) ;
76
72
}
77
73
}
You can’t perform that action at this time.
0 commit comments