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

The prefix is not removed when we set the control value #1301

Closed walkadaw closed 6 months ago

walkadaw commented 8 months ago

🐞 bug report

Is this a regression?

Yes, the previous version in which this bug was not present was: 16.x.x

Description

When we set in control value with prefix control value equal value what we set.

πŸ”¬ Minimal Reproduction

https://stackblitz.com/...

πŸ”₯ Exception or Error




const prefix = 'prefix';
const value = '000123'

control.setValue(prefix + value);

control.value === value // true

🌍 Your Environment

Angular Version:





Anything else relevant?

andriikamaldinov1 commented 6 months ago

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