-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formatting does not return country to default #1654
Comments
Sorry I don't understand the issue. Following your instructions, on the demo site I just did the following in the console: const iti = window.intlTelInput.instances[0];
iti.setNumber("+17021231234");
document.querySelector("#phone").value = "123"
iti.setNumber("+447947123123"); After the first |
If the second number is missing the country code, there isn't a case for returning to the default. e.g. |
As of the latest version, v23.0.12, you should be able to call |
Plugin version
v23.0.4
Steps to reproduce
Expected behaviour
If there is a valid country code: it'll pick out the country for it,
if not: then it would reset to the default
Actual behaviour
If you first open a number that lacks the code, it'll stay as default as intended.
If you open a number that has the code, and after open one without it - the country will still be set to the previous number's country after the format.
Initialisation options
countryOrder: ["ee", "fi", "se", "no", "dk", "de", "gb"],
countrySearch: false,
utilsScript: "https://cdn.jsdelivr.net/npm/[email protected]/build/js/utils.js",
nationalMode: false, (added due to the leading 0 causing issues)
The text was updated successfully, but these errors were encountered: