Skip to content

Commit e578981

Browse files
Merge pull request #628 from OpenSignLabs/fix_issue
fix: remove validation for text input widgets
2 parents 498e0c6 + c4297a2 commit e578981

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

apps/OpenSign/src/components/pdf/PlaceholderType.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function PlaceholderType(props) {
3838
"December"
3939
];
4040
const validateExpression = (regexValidation) => {
41-
if (textValue) {
41+
if (textValue && regexValidation) {
4242
let regexObject = regexValidation;
4343
if (props.pos?.options?.validation?.type === "regex") {
4444
regexObject = RegexParser(regexValidation);
@@ -56,7 +56,7 @@ function PlaceholderType(props) {
5656
props.setDraggingEnabled(true);
5757
const validateType = props.pos?.options?.validation?.type;
5858
let regexValidation;
59-
if (validateType) {
59+
if (validateType && validateType !== "text") {
6060
switch (validateType) {
6161
case "email":
6262
regexValidation = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
@@ -66,12 +66,8 @@ function PlaceholderType(props) {
6666
regexValidation = /^[0-9\s]*$/;
6767
validateExpression(regexValidation);
6868
break;
69-
case "text":
70-
regexValidation = /^[a-zA-Z\s]+$/;
71-
validateExpression(regexValidation);
72-
break;
7369
default:
74-
regexValidation = props.pos?.options.validation.pattern;
70+
regexValidation = props.pos?.options?.validation?.pattern || "";
7571
validateExpression(regexValidation);
7672
}
7773
}

0 commit comments

Comments
 (0)