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

"0" pattern followed by a "9" optional pattern (09) allows comma and dot after the "0" pattern

Open MatMercer opened this issue 4 years ago • 3 comments

Example

https://stackblitz.com/edit/angular-211yuk https://angular-211yuk.stackblitz.io

Problem

If you use a mask with the pattern "09*" it will allow a , or . after the first number If you use a mask with the pattern "00009*" it will allow a , or . after the forth number.

Expected Behavior

The mask should not allow a comma or dot after the mandatory number 0.

MatMercer avatar Feb 28 '20 01:02 MatMercer

The same issue. all '9' chars can be replaced with dot. I tried to reproduce the issue with 6.1 version, that version works correctly. Waiting for fix... It breaks all masks in product.

alexermolov avatar Mar 04 '20 14:03 alexermolov

h 6.1

I tested it and the version 7.9.10 works correctly too.

MatMercer avatar Mar 09 '20 14:03 MatMercer

I am experiencing the same issue, even the temporary solution won't work for me.

<input [(ngModel)]="startDate" mask="09/09/0099" />

Inputs: 1/1/2020 11122020 1/1/20

expected output 1/1/2020 11/12/2020 1/1/20

Output

1//1//2020 11/12/2020 1//1//20

https://stackblitz.com/edit/angular-ivy-zqzaez?file=src%2Fapp%2Fapp.component.html

Angular version: 12, ngx-mask version: 12

Let me know if someone finds a solution.

I tried this in ngx-mask version 7.9 and it works correctly. Here is the stackblitz: https://stackblitz.com/edit/angular-ufuneg?file=src%2Fapp%2Fapp.module.ts

saikiransheshagiri avatar Sep 02 '21 02:09 saikiransheshagiri

@MatMercer @alexermolov Thanks for your using Ngx-Mask. Please update to latest version. It example, all work as expected - https://stackblitz.com/edit/angular-pzr1tc?file=src%2Fmain.ts

andriikamaldinov1 avatar May 25 '23 08:05 andriikamaldinov1