react-phone-input-2 icon indicating copy to clipboard operation
react-phone-input-2 copied to clipboard

Some of islands having own iso2 and dial code are missing.

Open valeri-putskov opened this issue 5 years ago • 2 comments

Some of islands having own iso2 code and dialing code but belonging to bigger country, are not existing in the list of rawCountries. Therefore when you try to set it as a defaultCountry the ReactPhoneInput falls with "unable to get value of of undefined" in different situations. where is, at least I faced whith, is the iso2 or dialCode.

Problematic countries(or islands) list is below 'Aland Islands', 'ax' belongs to 'Finland', 'fi' dial code is similar: 358 'Christmas Island', 'cx' belongs to 'Australia', 'au' dial code is similar: 61 'Cocos (Keeling) Islands', 'cc' belongs to 'Australia', 'au' dial code is similar: 61 'Guernsey', 'gg' belongs to 'United Kingdom', 'gb' dial code is similar: 44 'Isle of Man', 'im' belongs to 'United Kingdom', 'gb' dial code is similar: 44 'Jersey', 'je' belongs to 'United Kingdom', 'gb' dial code is similar: 44 'Pitcairn Islands', 'pn' belongs to 'New Zealand', 'nz' dial code is similar: 64 'Svalbard and Jan Mayen', 'sj' belongs to, 'Norway', 'no' dial code is similar: 47 'United States Minor Outlying Islands', 'um' belongs to 'United States', 'us' dial code is similar: 1 'Mayotte', 'yt' belongs to 'Reunion', 're', dial code is similar: 262

I overcame this problem with doing a substitutes(ax->fi, cx->au...) in the code that uses the control, so that I never put the iso2 codes that aren't existing in ReactPhoneInput, but this is terrible solution and will stay there only as a temporary solution.

With best regards, Valeri

valeri-putskov avatar Dec 13 '19 13:12 valeri-putskov