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

Mask with optional digits skips input character #648

Closed
ccosmincc opened this issue Dec 19, 2019 · 4 comments
Closed

Mask with optional digits skips input character #648

ccosmincc opened this issue Dec 19, 2019 · 4 comments

Comments

@ccosmincc
Copy link

Given the following mask for a credit card which should contain 12 to 19 characters, first 12 being mandatory and the rest optional, grouped in 4 character groups, when trying to type the first character of the last optional group, it is skipped, being replaced with a space character.

Steps to reproduce:

mask="0000 0000 0000 9999 9999"
input: 1234 1234 1234 1234 1234
output: 1234 1234 1234 1234 234
expected output: 1234 1234 1234 1234 1234

@WESquad-oldmember
Copy link

Have the exact same issue on trying to validate an IBAN.

Tested on Angular 11.0.5 with a reactive form.

mask="SS00 AAAA 0000 0000 0000 0000 9999 9999 99"
input="FR12345678901234567890123456789012"
output="FR12 3456 7890 1234 5678 9012 3456 890 2"
expected output=""FR12 3456 7890 1234 5678 9012 3456 7890 12"

Also, issue does not happen when pasting value inside the input instead of typing it.

@SlippySken
Copy link

Nothing new with this problem?

@GlebChiz
Copy link
Contributor

@SlippySken We took this issue in work. We will have fixed this issue in some days.

GlebChiz added a commit that referenced this issue May 26, 2022
NepipenkoIgor pushed a commit that referenced this issue May 29, 2022
* fix(#648): issue where mask with optional digits skips input character

* fix(#648): added tests

* fix(#648): update version and changelog
@NepipenkoIgor
Copy link
Collaborator

@ccosmincc @WESquad-spires @SlippySken Hi all . Thank you that using ngx-mask. Please try version >= 13.1.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants