material-ui-phone-number icon indicating copy to clipboard operation
material-ui-phone-number copied to clipboard

conflicts with autocomplete and different number formats

Open llampwall opened this issue 4 years ago • 6 comments

If I let Chrome autocomplete the form that contains this component, which a lot of people do, this breaks. My saved form data doesn't have the country code in it (most people here in the US don't use it). I live in Los Angeles, so my normal 10-digit number starts with 310. material-ui-phone-number assumes that "31" is the country code, and that i live in the Netherlands. I'm hoping that I just missed something that deals with this, but so far I don't see anything.

llampwall avatar Aug 10 '20 05:08 llampwall

defaultCountry='us' might be helpful in your case.

ctrlaltdylan avatar Oct 05 '20 15:10 ctrlaltdylan

Same issue here, after looking through the docs and trying the different flags on the component there doesn't seem to be anything built in that addresses this issue.

To me it seems like if I have countryCodeEditable={false} then the autocomplete from Google shouldn't overwrite the country code but it does.

For now I have just disabled autocomplete on this field in order to prevent a more frustrating user experience with autocomplete overwriting the user's selection but it would be great to see support for the countryCodeEditable={false} to prevent autocomplete from changing the country code.

cbisbee avatar Mar 02 '21 19:03 cbisbee

I'm seeing this issue as well. Any suggestions are welcomed.

shinepd avatar Nov 29 '21 00:11 shinepd

+1 for this. Our app serves demographics who are international, too. Browser autocomplete breaks it.

davext avatar Mar 14 '22 23:03 davext

+1 I have the same problem

nikitamax avatar Apr 26 '22 11:04 nikitamax

I have the same issue with autocomplete on MacOS (Safari). Mac try to past the +33 666600000 phone number, but instead of recognizing the +33 aera code, the +66 Area code is set to Thaïland code (+66). When I'm trying to autocomplete on Chrome, the aera code is field with 06 and the dialog says that the country code is incorrect.

When I set the default Aera code +33 in my app, if the phone number is starting with +, it should replace the country code correctly. If the area code is not starting with +, it should keep the default country code.

As someone as a solution for that?

igorschlum avatar Jan 29 '23 14:01 igorschlum