JsDaddy / ngx-mask

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

Adjust documentation about custom patterns #1306

Closed Lukowalski97 closed 6 months ago

Lukowalski97 commented 7 months ago

🚀 feature request

Description

During development I had a case where I needed to create a mask for hexadecimal values only, and I created my own custom pattern like this: {h: {pattern: new RegExp('[a-fA-F0-9]')}};

From documentation I knew only about default patterns which are 0, 9, A, S, U, L. Unfortunately h that I used is conflicting with MaskExpression.Hour and it resulted in a weird behaviour when I typed things like 24, 25 etc. In documentation I did not find info that patterns cannot clash with any of expressions and what are those expressions (or where to look for them). In my case I just changed pattern from h to z but it would be nice to have such info in documentation that custom patterns cannot clash with existing expressions.

Describe the solution you'd like

Mention about it in documentation

Lukowalski97 commented 7 months ago

Or what else comes to my mind - maybe adding some log if custom pattern name may clash with existing expression would be nice

andriikamaldinov1 commented 6 months ago

@Lukowalski97 Thanks for using Ngx-mask. We update our documentation, with conflict custom pattern.