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
In Version 23.0.7 the intlTelInput.getCountryData() static function returns empty string value for name property. It was working fine till v20.3.0
#1628
@jackocnr Thank you for resolving this issue. I had one follow-up question.
I was importing utils in my react application as below.
import utils from 'intl-tel-input/build/js/utils.js';
But now since the v23.0.0 release utils script is an ECMA module, i tried below
import utils from 'intl-tel-input/intlTelInputWithUtils';
And the code to instantiate remains the same as below. But validations are failing and i dont see any console errors. Am i importing Utils module in a wrong way?
const initPhoneInput = (ref) => {
intlTelInput(ref, {
utilsScript: utils,
initialCountry: '',
});
I also pointed directly to the new utils script as below
import utils from 'intl-tel-input/build/js/intlTelInputWithUtils.js';
Still validations are failing.
In both the case below code for getNumber() in the intlTelInput.js file is returning ""(empty string).Due to this i implied that utils are not getting loaded.
//* Format the number to the given format.
getNumber(format) {
if (intlTelInput.utils) {
const { iso2 } = this.selectedCountryData;
return intlTelInput.utils.formatNumber(
this._getFullNumber(),
iso2,
format
);
}
return "";
}
Plugin version
v23.0.7
Steps to reproduce
Expected behaviour
It should return countryName in the name property like below
[{
name: "Afghanistan",
iso2: "af",
dialCode: "93"
}, ...]
Actual behaviour
PFB the code example
https://codedamn.com/playground/zd47K7toOOFlCGB6ZPkky
Current output from intlTelInput.getCountryData() method is as below
[{
name: "",
iso2: "af",
dialCode: "93"
}, ...]
Initialisation options
None
The text was updated successfully, but these errors were encountered: