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

Why the last part of any phone number is joined with a - ? #680

Closed
alexdabast opened this issue Nov 18, 2023 · 2 comments · Fixed by #685
Closed

Why the last part of any phone number is joined with a - ? #680

alexdabast opened this issue Nov 18, 2023 · 2 comments · Fixed by #685
Assignees
Labels
P2 This issue has medium priority scope: phone Related to @maskito/phone

Comments

@alexdabast
Copy link

Hi,

On this line
https://github.com/taiga-family/maskito/blame/74654ef3e3807e462be2f0db1469d0ea9a4079ca/projects/phone/src/lib/masks/phone/utils/get-phone-template.ts#L10
A join with '-' is made for the last part of any phone number. This is wrong and breaks any validation done by libphonenumber-js library when using parsePhoneNumberFromString.
I assume it is maybe a standard format number in russia or other countries but many EU countries do not have any characters in their national phone number

@waterplea
Copy link
Contributor

Original libphonenumber by Google does use dashes though. Since our own standards suggest using dash and removal of it was a decision of libphonenumber-js author we reintroduced them. I suppose we can make this configurable.

@nsbarsukov nsbarsukov added P2 This issue has medium priority scope: phone Related to @maskito/phone labels Nov 20, 2023
@alexdabast
Copy link
Author

I see, thank you for clarification how ever as the phone addon is based on libphonenumber-js I think you should align the format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 This issue has medium priority scope: phone Related to @maskito/phone
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants