Skip to content
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

(BUG) status of isValid is turning into TRUE even if it's not correct #127

Open
abernados opened this issue Oct 21, 2020 · 3 comments
Open
Labels
bug Something isn't working

Comments

@abernados
Copy link

Describe the bug

When you select the Philippines and input a number, the status of isValid is turning into TRUE even if it's not correct. Sometimes isValid became TRUE if you entered 6 and 8 digits.

Steps to reproduce

  1. Go to https://louismazel.github.io/vue-phone-number-input/
  2. Test the basic usage
  3. Select PH/Philippines as a country
  4. Input 6 random numbers and isValid will become TRUE. Also when you input 8 random numbers, isValid will become TRUE.

Expected behavior

When you enter a number which is not the same format as the placeholder/hint above, it will not return the param, isValid, TRUE.
This is the correct format of the phone number:
image

Screenshots

I entered 6 random numbers:
image

I entered 8 random numbers:
image

@abernados abernados added the bug Something isn't working label Oct 21, 2020
@abernados abernados changed the title (BUG) (BUG) status of isValid is turning into TRUE even if it's not correct Oct 22, 2020
@mizhon
Copy link

mizhon commented Nov 29, 2020

Hi, I search on this for a while, and find the issuse is actually caused by the dependency lib: "libphonenumber-js"
It use the "parsePhoneNumberFromString" mehtod to get the parsing result and it's isValid() method is incorrect.
https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/19
image

@jaawaad
Copy link

jaawaad commented Dec 27, 2020

Has anyone found a solution to this problem?

@isokosan
Copy link

Try importing libphonenumber-js/max instead of libphonenumber-js, as that includes the minimum version which does not check some valid cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants