bl00mber / react-phone-input-2

:telephone_receiver: Highly customizable phone input component with auto formatting
https://bl00mber.github.io/react-phone-input-2.html
MIT License
949 stars 536 forks source link

Not taking in valid Argentina numbers #474

Open umakantmanu opened 2 years ago

umakantmanu commented 2 years ago

Below is the valid Argentine mobile number:

+54 91123017883

That 9 after +54 is the prefix introduced in 2003 which isn't considered here. Reference: http://www.wtng.info/wtng-54-ar.html

Based on other repo it was formed from:- this works fine with: https://catamphetamine.gitlab.io/react-phone-number-input/ but not with: https://bl00mber.github.io/react-phone-input-2.html

Trisky commented 2 years ago

It's worth considering that +54 11 23017883is also a valid number if you're calling from within the country. You only need the 9 when you call from another country, adding it as a local call has no practical effect. (yes, complicated country). Most of the people living in the country ignore the fact that you have to enter 9 when calling from other countries and would be confused by the presence of the 9 in a form since they've never seen it before.

Conclusion (IMHO):

+54 91123017883 and +54 11 23017883 should be both valid.

mmuszkow commented 2 years ago

From wikipedia:

In Argentina, area codes are two, three, or four digits long (after the initial zero). Local customer numbers are six to eight figures long

but this library accepts only 2 digit are codes so for example +54 (383) 12345678 (Catamarca area code) won't work

maclementED commented 1 year ago

Did you guys founded a solution for this ?

tlopesdigitalsign commented 8 months ago

Did someone updated the library and got it to work with the number 9? Btw, can somebody tell me if only the areas wich code has 2 digits work or all areas work even if their area as 3 or 4 digits?

eugene-ivanenko commented 7 months ago

Made it work by passing masks prop, like

<ReactPhoneInput
  masks={{
    ar: '. .. .... ....',
  }}
  ...
tjalopes commented 7 months ago

It worked for me, thank you!!