fix: [Hotfix]No phone number is valid (#9258)
* Fix invalid phone number always * Fix countrycode detection
This commit is contained in:
1 parent
268f1872e4
commit
b1019d6bab
1 file changed
+4
-2
@@ -30,7 +30,9 @@ function BasePhoneInput({ name, className = "", onChange, ...rest }: PhoneInputP
|
|||||||
required: rest.required,
|
required: rest.required,
|
||||||
placeholder: rest.placeholder,
|
placeholder: rest.placeholder,
|
||||||
}}
|
}}
|
||||||
onChange={(value) => onChange(value)}
|
onChange={(value) => {
|
||||||
|
onChange("+" + value);
|
||||||
|
}}
|
||||||
containerClass={classNames(
|
containerClass={classNames(
|
||||||
"hover:border-emphasis dark:focus:border-emphasis border-default !bg-default rounded-md border focus-within:outline-none focus-within:ring-2 focus-within:ring-brand-default disabled:cursor-not-allowed",
|
"hover:border-emphasis dark:focus:border-emphasis border-default !bg-default rounded-md border focus-within:outline-none focus-within:ring-2 focus-within:ring-brand-default disabled:cursor-not-allowed",
|
||||||
className
|
className
|
||||||
@@ -63,7 +65,7 @@ const useDefaultCountry = () => {
|
|||||||
retry: false,
|
retry: false,
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
if (isSupportedCountry(data?.countryCode)) {
|
if (isSupportedCountry(data?.countryCode)) {
|
||||||
setDefaultCountry(data.countryCode);
|
setDefaultCountry(data.countryCode.toLowerCase());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user