fix: [Hotfix]No phone number is valid (#9258)
* Fix invalid phone number always * Fix countrycode detectionpull/9259/head^2
parent
268f1872e4
commit
b1019d6bab
|
@ -30,7 +30,9 @@ function BasePhoneInput({ name, className = "", onChange, ...rest }: PhoneInputP
|
|||
required: rest.required,
|
||||
placeholder: rest.placeholder,
|
||||
}}
|
||||
onChange={(value) => onChange(value)}
|
||||
onChange={(value) => {
|
||||
onChange("+" + value);
|
||||
}}
|
||||
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",
|
||||
className
|
||||
|
@ -63,7 +65,7 @@ const useDefaultCountry = () => {
|
|||
retry: false,
|
||||
onSuccess: (data) => {
|
||||
if (isSupportedCountry(data?.countryCode)) {
|
||||
setDefaultCountry(data.countryCode);
|
||||
setDefaultCountry(data.countryCode.toLowerCase());
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue