No idea, this came up while trying to update our dependency on cleave.js for a mask for a date field. Tested versions are 17.0.6 and 17.0.7 (latest at time of writing).
Description
There is some weird behavior going on when an input field is bound using ngModel and the underlying model is updated in code.
Type any valid date in the input field (ex. 01/01/1999)
The model is updated to this new value - output in console while typing is as expected.
Click the 'update model' button. This will set the myValue variable to 01/01/2000. The underlying variable is modified as seen next to the 'The model: ' text, but the displayed value in the textbox is not. Neither is the ngModelChanged method called.
-> If the value of the textbox is empty and the button is clicked, both the model and the displayed text in the input are correct.
-> If you typed anything in the textbox before emptying it and clicking the button the behavior is as described above where the input displays the old value.
🔥 Exception or Error
None
🌍 Your Environment
Angular Version:
Exactly as in the stackblitz example. Angular 17, ngx-mask 17.0.6 and 17.0.7 (both have this issue).
🐞 bug report
Is this a regression?
No idea, this came up while trying to update our dependency on cleave.js for a mask for a date field. Tested versions are 17.0.6 and 17.0.7 (latest at time of writing).
Description
There is some weird behavior going on when an input field is bound using ngModel and the underlying model is updated in code.
🔬 Minimal Reproduction
Stackblitz
-> If the value of the textbox is empty and the button is clicked, both the model and the displayed text in the input are correct. -> If you typed anything in the textbox before emptying it and clicking the button the behavior is as described above where the input displays the old value.
🔥 Exception or Error
None
🌍 Your Environment
Angular Version:
Exactly as in the stackblitz example. Angular 17, ngx-mask 17.0.6 and 17.0.7 (both have this issue).