JsDaddy / ngx-mask

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

dropSpecialCharacters set to false still drops characters #1297

Closed WebTechnolog closed 7 months ago

WebTechnolog commented 10 months ago

🐞 bug report

Is this a regression?

Probably yes. It should work according to the docs, so I presume it worked as expected.

Description

When dropSpecialCharacters is set to false the mask still does not allow any special characters.

🔬 Minimal Reproduction

https://stackblitz.com/edit/stackblitz-starters-5ojvqe

🌍 Your Environment

Angular Version:

@angular-devkit/architect 0.1700.7 @angular-devkit/build-angular 17.0.7 @angular-devkit/core 17.0.7 @angular-devkit/schematics 17.0.7 @angular/cdk 17.0.4 @angular/material 17.0.4 @schematics/angular 17.0.7 ng-packagr 17.0.3 rxjs 7.5.7 typescript 5.2.2 zone.js 0.14.2

andriikamaldinov1 commented 7 months ago

@WebTechnolog Thank for using Ngx-mask. dropSpecialCharacters = false, means that if there are any special characters in the mask, it will display them in the model. For example mask="00 00" with dropSpecialCharacters = false if you write 1234 Model with false => 12 34 Model with true => 1234 If you wanna to allow special characters you need to write custom pattern for this. It example - https://stackblitz.com/edit/stackblitz-starters-vkjxdp?file=src%2Fmain.ts