-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Phone validation #1987
fix: Phone validation #1987
Conversation
The latest updates on your projects. Learn more about Vercel for Git 鈫楋笌 |
Thank you for following the naming conventions for pull request titles! 馃檹 |
packages/surveys/src/components/questions/OpenTextQuestion.tsxThe current phone number validation pattern is a bit too lenient and could be improved to better match common phone number formats. This will help ensure that users enter their phone numbers in a consistent and expected format. pattern={question.inputType === "phone" ? "^\\+?[1-9]\\d{1,14}$" : ".*"}
The current form submission process involves a lot of repeated code and unnecessary calculations. By moving the form submission logic into a separate function, we can improve the performance and readability of the code. const handleSubmit = (e) => {
e.preventDefault();
const updatedttc = getUpdatedTtc(ttc, question.id, performance.now() - startTime);
setTtc(updatedttc);
onSubmit({ [question.id]: value, inputType: question.inputType }, updatedttc);
};
// Then replace the onSubmit handlers with this function
onSubmit={handleSubmit}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dhruwang thanks for the changes 馃槉馃挭
* main: (87 commits) fix: remove default env vars in docker compose (formbricks#2018) feat: cache web builds & playwright binaries in CI (formbricks#2009) chore: prepare 1.5.1 release (formbricks#2012) docs: add ClassroomIO to OSS Friends (formbricks#2008) feat: Add support for Cloudfront country header (formbricks#2003) fix: create survey API expects creator (formbricks#2007) fix: ECS deployment GitHub Action (formbricks#2005) chore: remove old CLA form from docs & github templates (formbricks#1995) fix: ecs github action (formbricks#1992) feat: auto subscribing to teams survey responses email (formbricks#1990) fix: formbricks-com build errors (formbricks#1991) fix: default autocomplete value (formbricks#1986) chore: Tweaked survey list (formbricks#1978) feat: enable weekly summary & support for callbacks on login (formbricks#1885) fix: ecs-deployment.yml (formbricks#1989) fix: ECS deployment Github Action (formbricks#1988) fix: links and survey overlapping (formbricks#1985) fix: Phone validation (formbricks#1987) fix: app page redirect throws error (formbricks#1984) feat(github action): Add's a new GitHub Action to deploy webapp to ECS cluster (formbricks#1982) ...
What does this PR do?
Fixes # 1786 #1963
How should this be tested?
Checklist
Required
pnpm build
console.logs
git pull origin main
Appreciated