From 2e964173b4394f67983cbf9f9ba9bb60626220eb Mon Sep 17 00:00:00 2001 From: Urvish Date: Thu, 5 Nov 2026 15:33:14 +0530 Subject: [PATCH] fix(auth): clear phone number field when country changes during sign up --- src/features/auth/components/SignUpForm.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/features/auth/components/SignUpForm.tsx b/src/features/auth/components/SignUpForm.tsx index ff12ded..acb7ad4 100644 --- a/src/features/auth/components/SignUpForm.tsx +++ b/src/features/auth/components/SignUpForm.tsx @@ -70,12 +70,12 @@ export default function SignUpForm() { }; const handleCountrySelect = (c: CountryCode) => { + if (c.country !== selectedCountry.country) { + setPhone(""); + } setSelectedCountry(c); setShowCountryModal(false); setCountrySearch(""); - if (phone.length > c.maxLength) { - setPhone(phone.slice(0, c.maxLength)); - } if (phoneError) setPhoneError(""); };