-
-
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
Incorrect Flag Detection Due to Phone Masking in intl-tel-input Library #1501
Comments
This seems like an issue with your masking library, not this library! This library doesn't prevent you from typing plus or anything else! |
Thank you for the response. We are not utilizing an external masking library. For masking, we are using the following code: HTML Code:
TypeScript Code:
Please suggest a code fix based on this information. |
Well as I said, this library doesn't prohibit you from typing plus or anything else, as you can see from the demo page. So it must be your custom code that is doing this. If you comment out all of your masking code, does that fix the issue?
You appear to be using the jQuery mask plugin, no?
|
Actual behaviour
Currently, when attempting to enter international numbers, the library does not allow the use of the "+" symbol, resulting in incorrect flag detection. Manually changing the flag before entering the number works as expected.
Scenario 1: Right now, we have US phone masking on Intl-tel-input field. It picks US and Canadian number and changes the flag accordingly. but in the case of international numbers like PK, IND, China as it does not allow + symbol so it does not detect and auto selects the flag.
Screenshot Scenario 1:
Scenario 2: If we manually change the flag first and enter the number after that it allows to enter the international numbers
Screenshot Scenario 2:
Scenario 3: If we remove this mask all together from code then entering the phone number starting with country code automatically picks the correct flag
Screenshot Scenario 3:
Expected behavior
Entering international numbers without removing mask from code, such as those from PK, IND, or China, should automatically detect the corresponding country flag without manual intervention.
Initialization options
The library is configured with US phone masking, causing issues with the detection of international numbers.
The code is initially implemented using "Angular version 16" and "intl-tel-input version 17.0.21."
Code Snippet
The text was updated successfully, but these errors were encountered: