fix(auth): clear phone number field when country changes during sign up #113
|
|
@ -70,12 +70,12 @@ export default function SignUpForm() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCountrySelect = (c: CountryCode) => {
|
const handleCountrySelect = (c: CountryCode) => {
|
||||||
|
if (c.country !== selectedCountry.country) {
|
||||||
|
setPhone("");
|
||||||
|
}
|
||||||
setSelectedCountry(c);
|
setSelectedCountry(c);
|
||||||
setShowCountryModal(false);
|
setShowCountryModal(false);
|
||||||
setCountrySearch("");
|
setCountrySearch("");
|
||||||
if (phone.length > c.maxLength) {
|
|
||||||
setPhone(phone.slice(0, c.maxLength));
|
|
||||||
}
|
|
||||||
if (phoneError) setPhoneError("");
|
if (phoneError) setPhoneError("");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue