You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug can be reproduced when using an "optional" mask (NOT optional characters) like in the reproduction by setting the [mask] input to something then to undefined.
Context: a simple 4 number mask input, but the mask can be toggled on/off. My use case is not a button toggle, but simply toggling the mask programmatically. But it is easier to show the problem with a button.
Scenario 1
Steps:
Write any 4 length number into the input, like "1234" with the mask on.
Then do not finish typing but write any other character(s).
Toggle the mask off.
Bug: you will see the last typed character (from 2.) in the input. The FormControl.value is good ("1234"). I do not want to see this extra character in the input.
Scenario 2
Steps:
Write letters into the input with the mask off, like "asd".
Toggle the mask on. The input and the value will be set to "" because of the mask. This is okay.
Toggle the mask off.
Bug: you will see your previously written letters in the input. The FormControl.value is good (""). I do not want to see these extra characters in the input.
🐞 bug report
Description
Bug can be reproduced when using an "optional" mask (NOT optional characters) like in the reproduction by setting the
[mask]
input to something then toundefined
.Context: a simple 4 number mask input, but the mask can be toggled on/off. My use case is not a button toggle, but simply toggling the mask programmatically. But it is easier to show the problem with a button.
Scenario 1
Steps:
"1234"
with the mask on.FormControl.value
is good ("1234"
). I do not want to see this extra character in the input.Scenario 2
Steps:
"asd"
.""
because of the mask. This is okay.FormControl.value
is good (""
). I do not want to see these extra characters in the input.🔬 Minimal Reproduction
https://stackblitz.com/edit/ngx-mask-ghost-input-value?file=src%2Fapp%2Fapp.component.html
🌍 Your Environment
Angular Version:
ngx-mask Version:
The text was updated successfully, but these errors were encountered: