JsDaddy / ngx-mask

Angular Plugin to make masks on form fields and html elements.
https://jsdaddy.github.io/ngx-mask
MIT License
1.14k stars 298 forks source link

Mask with or (||) does not work. #1356

Open patrik-upspot opened 2 months ago

patrik-upspot commented 2 months ago

🐞 bug report

Is this a regression?

I'm not sure, but i think in version 14 will it work like a charm ### Description I have a masking for initials. The initials should be separated by a dot and can contain one to 5 letters. The problem comes with an update of ng-mask. in a earlier version i didnt have problems with this mask. now the "or" (||) masks will not be evaluated. actually i use "ngx-mask": "~15.2.3" with Angular 15. With Version "ngx-mask": "~15.0.2" the Mask will work perfectly, but if i backspace, i have to set the cursor before the Character. In Version 15.2.3 the mask does not fit, but the backspace works without problems. and i version 14 both works without problems. ## πŸ”¬ Minimal Reproduction

https://stackblitz.com/edit/angular-ivy-5agzc8?file=src%2Fapp%2Fapp.component.ts Version 14 will work

πŸ”₯ Exception or Error


I does not get an Exception or Error. It's not possible to put more than one character. If i change the past to:
"S.S.S.S.S." the last dot appears only if i put five characters into the field.

🌍 Your Environment

Angular Version:


Angular CLI: 15.2.10
Node: 16.20.2
Package Manager: npm 8.19.4
OS: win32 x64

Angular: 15.2.10
... animations, cli, common, compiler, compiler-cli, core
... elements, forms, platform-browser, platform-browser-dynamic
... platform-server, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.10
@angular-devkit/build-angular   15.2.10
@angular-devkit/core            15.2.10
@angular-devkit/schematics      15.2.10
@angular/cdk                    15.2.9
@angular/material               15.2.9
@nguniversal/builders           15.2.1
@nguniversal/express-engine     15.1.0
@schematics/angular             15.2.10
rxjs                            7.5.7
typescript                      4.8.4

"ngx-mask": "~15.2.3",

Anything else relevant?