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

valueChanges emitts when an incorrect value is set programmatically #1372

Open CarlaMorosan opened 1 week ago

CarlaMorosan commented 1 week ago

🐞 bug report

Description

valueChanges emitts when an incorrect value is set programmatically

🔬 Minimal Reproduction

Check Stackblitz: https://stackblitz.com/edit/angular-ivy-mask-fsq2va?file=src%2Fapp%2Fapp.component.ts

  1. Have an input with a form control
  2. Set the 'SSS-SSS-SSS' mask
  3. Subscribe to the form control's valueChanges
  4. Set the form control with an incorrect value (e.g. 978-1-93624-386-0)
  5. Check the value emitted

🔥 Exception or Error

valueChanges emitts the incorrect value, even though the value wasn't applied in the input