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

Dynamically placeholder value #1341

Open titkovvladislav opened 3 months ago

titkovvladislav commented 3 months ago

🐞 bug report

Is this a regression?

Yes, the previous version in which this bug was not present was: 16.4.1 ### Description The input stops working correctly when the placeholder value changes dynamically. ## πŸ”¬ Minimal Reproduction In the created example, if you enter a number, everything works correctly - a mask is applied and a suffix is added. But if we change the placeholder, then everything breaks down - the number is not entered correctly and the suffix disappears.. https://stackblitz.com/edit/stackblitz-starters-kzxrzr?file=src%2Fmain.ts Same thing here, only version "ngx-mask": "^16.4.1": https://stackblitz.com/edit/stackblitz-starters-aip3vn?file=src%2Fmain.ts Note that the suffix here also applies to the placeholder..

🌍 Your Environment

Angular Version:




Angular CLI: 17.3.2
Node: 18.20.0
Package Manager: npm 10.5.0
OS: win32 x64

Angular: 17.3.2
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, material-moment-adapter, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.2
@angular-devkit/build-angular   17.3.2
@angular-devkit/core            17.3.2
@angular-devkit/schematics      17.3.2
@schematics/angular             17.3.2
rxjs                            7.8.1
typescript                      5.4.3
zone.js                         0.14.4

Anything else relevant?