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

🐞 - maskitoPhoneOptionsGenerator allows to enter invalid Ukrainian phone number #714

Closed
6 of 9 tasks
davidarny opened this issue Dec 4, 2023 · 1 comment
Closed
6 of 9 tasks
Assignees
Labels
bug Something isn't working

Comments

@davidarny
Copy link

Which package(s) are the source of the bug?

@maskito/core, @maskito/kit, @maskito/react

Playground Link

https://stackblitz.com/edit/stackblitz-starters-1aetx2

Description

Hi!
Very much appreciated for this library! Love it ❤️

I'm using a function maskitoPhoneOptionsGenerator from @masktio/phone and having some issues with masking against Ukrainian phone numbers.

A valid Ukrainian phone number includes 9 digits after +380 country code. I'm validating phone number with libphonenumber-js and getting invalid results when user types 10 digits. Question is why user is able to type 10 digits?

Screen Recording 2023-12-04 at 23 07 38 mov

Maskito version

1.9.0

Which browsers have you used?

  • Chrome
  • Firefox
  • Safari
  • Edge

Which operating systems have you used?

  • macOS
  • Windows
  • Linux
  • iOS
  • Android
@davidarny davidarny added the bug Something isn't working label Dec 4, 2023
@github-project-automation github-project-automation bot moved this to 💡 Backlog in Taiga-family Dec 4, 2023
@waterplea
Copy link
Contributor

waterplea commented Dec 5, 2023

libphonenumber has several reasons for the number to be invalid. One particular one is "TOO LONG". I believe we only limit length of the number once it hits this error since we delegate source of truth to libphonenumber because we cannot know about every country phone number lengths:
https://github.com/taiga-family/maskito/blob/main/projects/phone/src/lib/masks/phone/utils/cut-phone-by-valid-length.ts
Some countries may have valid phones of different lengths.

@nsbarsukov nsbarsukov closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2023
@github-project-automation github-project-automation bot moved this from 💡 Backlog to ✅ Done in Taiga-family Dec 6, 2023
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
No open projects
Status: Done
Development

No branches or pull requests

3 participants