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

Does not work with Angular 12

Open ssougnez opened this issue 3 years ago • 4 comments

🐞 bug report

Is this a regression?

No idea

Description

It simply does not work :-) I tried with this code:

<input name="niss" type="text" formControlName="niss" mask="99.99.99-999.99" [showMaskTyped]="true" />

So nothing very fancy. At first, it seems to be working:

image

But as soon as I type something:

image image

And at the end, the mask isn't even respected:

image

I'm surprised that I didn't find any issue relating to that because it simply nullifies the point of this library.

🔬 Minimal Reproduction

<input name="niss" type="text" formControlName="niss" mask="99.99.99-999.99" [showMaskTyped]="true" />

🔥 Exception or Error

None

🌍 Your Environment

Angular Version:

Angular CLI: 12.2.11
Node: 14.16.1
Package Manager: yarn 1.22.4
OS: win32 x64

Angular: 12.2.11
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.11
@angular-devkit/build-angular   12.2.11
@angular-devkit/core            12.2.11
@angular-devkit/schematics      12.2.11
@schematics/angular             12.2.11
rxjs                            6.6.7
typescript                      4.3.5

ssougnez avatar Nov 03 '21 23:11 ssougnez

Same problem using mask to mask a input test as date <input name="dateOfBirth" type="text" formControlName="dateOfBirth" mask="99-99-9999" [showMaskTyped]="true" />

89snake89 avatar Nov 11 '21 14:11 89snake89

By looking at the issue in this repository, it's clear that this library is not maintained anymore. I migrated to https://www.npmjs.com/package/@ngneat/input-mask which seems to perfectly fit the need and is actively maintained.

ssougnez avatar Nov 11 '21 14:11 ssougnez

Don't works here as well. I'm using angular 12 and after installing, tons of compile errors appeared in my console. I even bother to ask for help, moving to other component like @ssougnez suggested.

SuperSoldado avatar Jan 06 '22 16:01 SuperSoldado

Yes I used the component suggested by @ssougnez For input date mask worked perfectly on Angular 12

89snake89 avatar Jan 06 '22 16:01 89snake89

@ssougnez @89snake89 Thank you that shown this issues. Please try ngx-mask >= 14.2.2 Short demonstration https://stackblitz.com/edit/angular-material-13-starter-x1xj4z-tbuvib?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.ts

@SuperSoldado If you found some issues in your local environment please provide issue by template and also include your dependencies .

NepipenkoIgor avatar Sep 13 '22 14:09 NepipenkoIgor