ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

Ngx-mask with special character "+" not autofilling in v18.0.4

Open KingDarBoja opened this issue 8 months ago • 0 comments

🐞 bug report

Is this a regression?

Yes, the previous version in which this bug was not present was: ngx-mask v16.4.2 (and older)

Description

There are two issues with the ngx-mask versions 18 & 19.

  1. The mask does not autofill after typing numbers or characters when there is a special character at the beginning. It used to autofill in previous version (at least 16.4.2 and older).

Example: Mask -> +(000) 00000099999 Typing a number should autofill the first special character "+", but it doesn't work as before and now I have to manually type the "+" sign to use the inpput field.


  1. The mask does not validate when there is a "-" special character in a mask as @A*-A*, it only takes into account the first 4 characters or more after the first asterisk but doesn't require the "-" and therefore the input can be submitted incomplete.

Example: Mask -> @A*-A*

  • @te-abc should be valid.
  • @taaaa should be invalid but it is marked as valid nowadays and the "-" sign isn't required.

🔬 Minimal Reproduction

I have made two stackblitz to showcase how the first issue (autofill with "+") works with v14.3.3 and how the second issue has been buggy in all versions since 14.

You can change the version at the stackblitz with ngx-mask v18 to see how the first issue still works with v16.4.2 but not v17, v8 or even v19 of this library.

🌍 Your Environment

Angular Version: v18 for the sake of these examples.

KingDarBoja avatar Feb 07 '25 18:02 KingDarBoja