Open
Description
Thanks for such an excellent library!
When I select an email, I’m trying to populate the phone number as well, but it isn’t working. If I comment out the country prop, a random country is displayed, but the email selection then works to pre-populate the phone. Is there a solution to make it work with the country? It would really help save the user time by avoiding the need to manually select the country or enter the country code if there is no phone in the address book?
<PhoneInput
country={
values.phoneDefaultCountry ? values.phoneDefaultCountry : values.customerRegion === 'GBP' ? 'gb' : 'us'
}
inputClass='pl-4 py-6 !w-full outline-none text-gray-600 font-light'
containerClass='phone-input-container'
specialLabel=''
value={values.phone}
onChange={(value: any) => {
setFieldValue('phone', value)
console.log(value, 'value phone')
}}
preferredCountries={['gb', 'us']}
inputProps={{
name: 'phone',
required: true,
autoComplete: 'tel'
}}
/>
On selection of email phone is not populating:
When I removed the country prop, the number populates correctly, but the country shows as random. However, when the phone number populates, it gives me the correct country that the code belongs to, which is correct
Metadata
Assignees
Labels
No labels
Activity