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

NgxMaskPipe keeps previous configs when transform() called #1308

Closed bsayat closed 6 months ago

bsayat commented 7 months ago

🐞 bug report

Description

when you call transform() method of NgxMaskPipe with some configs, this configs affects on another transform() method call without/with configs.

🔬 Minimal Reproduction

console.log(this._mask.transform('55555', '00 (000)', { suffix: ' DDD' })); // 55 (555) DDD
console.log(this._mask.transform('55555', '00 (000)', { prefix: 'DDD ' })); // DDD 55 (555) DDD

https://stackblitz.com/edit/stackblitz-starters-udi4kf?file=src%2Fmain.ts

🌍 Your Environment

You can find it in stackblitz

andriikamaldinov1 commented 6 months ago

@bsayat Thanks for using Ngx-mask. Please update to latest version. It example all work as expected - https://stackblitz.com/edit/stackblitz-starters-ggvjfy?file=src%2Fmain.ts