Entering ? at the beginning of a number validates but doesn't check international dropdown
Steps to reproduce
- go to example web site https://intl-tel-input.com/node_modules/intl-tel-input/examples/gen/is-valid-number.html
- pick India as an example country
- enter a valid Australian number but with ? around it, such as ?+61 412 345 678?
Expected behaviour
It should return an invalid number, or switch the country in the dropdown to Australia
Actual behaviour
it says its a valid number. iti.isValidNumber() is true and iti.getNumber() returns +61412345678 iti.selectedCountryData.dialCode return 91
Initialisation options
check initialisation on example page
Yeah I agree. I'd welcome a pull request to fix this. From a quick glance, I think the issue is in the formatNumber method in utils.js.
Still not fixed. Writing number first and than changing flag makes always invalid number. It's a bug and a big one.
It turns out even a space is enough to stop the selected country from auto-updating as you type (e.g. if you type " +44" it doesn't update). This is now fixed in v18.5.2.