You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When country is switched to another country that has the same international prefix, say USA and Canada, then when you start typing the phone number, the flag switches back to the first one. This is due to this code in index.js:
This in turn calls PhoneNumber.getCountryCodeOfNumber from phoneNumber.js:
getCountryCodeOfNumber(number){constdialCode=this.getDialCode(number);constnumeric=this.getNumeric(dialCode);constcountryCode=Country.getCountryCodes()[numeric];// countryCode[0] can be null -> get first element that is not nullif(countryCode){return_.first(countryCode.filter(iso2=>iso2));}return'';}
You will notice that the first element (in this case US) gets returned. We should allow for overlapping prefixes.
The text was updated successfully, but these errors were encountered:
When country is switched to another country that has the same international prefix, say USA and Canada, then when you start typing the phone number, the flag switches back to the first one. This is due to this code in
index.js
:This in turn calls
PhoneNumber.getCountryCodeOfNumber
from phoneNumber.js:You will notice that the first element (in this case US) gets returned. We should allow for overlapping prefixes.
The text was updated successfully, but these errors were encountered: