Fixed where empty pattern was passed when switching from phone

This commit is contained in:
Naitik
2023-10-06 14:51:01 +05:30
parent c9f22290c4
commit 3bf7d732c2

View File

@@ -79,8 +79,8 @@ export default function OpenTextQuestion({
type={question.inputType}
onInput={(e) => handleInputChange(e.currentTarget.value)}
autoFocus={autoFocus}
pattern={question.inputType === "phone" ? "[+][0-9]+" : undefined}
title={question.inputType === "phone" ? "Enter a valid phone number (+123...)" : undefined}
pattern={question.inputType === "phone" ? "[+][0-9 ]+" : ".*"}
title={question.inputType === "phone" ? "Enter a valid phone number" : undefined}
className={`block w-full rounded-md border
border-slate-100
bg-slate-50 p-2 shadow-sm focus:border-slate-500 focus:outline-none focus:ring-0 sm:text-sm`}
@@ -96,7 +96,7 @@ export default function OpenTextQuestion({
type={question.inputType}
onInput={(e) => handleInputChange(e.currentTarget.value)}
autoFocus={autoFocus}
pattern={question.inputType === "phone" ? "[+][0-9]+" : undefined}
pattern={question.inputType === "phone" ? "[+][0-9 ]+" : ".*"}
title={question.inputType === "phone" ? "Please enter a valid phone number" : undefined}
className={`block w-full rounded-md border
border-slate-100