Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghost characters shown in input when toggling mask on/off #897

Closed
Res42 opened this issue May 14, 2021 · 1 comment
Closed

Ghost characters shown in input when toggling mask on/off #897

Res42 opened this issue May 14, 2021 · 1 comment

Comments

@Res42
Copy link

Res42 commented May 14, 2021

🐞 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 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:

  1. Write any 4 length number into the input, like "1234" with the mask on.
  2. Then do not finish typing but write any other character(s).
  3. Toggle the mask off.
  4. 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.

image

Scenario 2

Steps:

  1. Write letters into the input with the mask off, like "asd".
  2. Toggle the mask on. The input and the value will be set to "" because of the mask. This is okay.
  3. Toggle the mask off.
  4. 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.

image

🔬 Minimal Reproduction

https://stackblitz.com/edit/ngx-mask-ghost-input-value?file=src%2Fapp%2Fapp.component.html

🌍 Your Environment

Angular Version:

^11.0.8

ngx-mask Version:

11.1.5
@NepipenkoIgor
Copy link
Collaborator

@Res42 Hi . Thank you for using our package. Please check version >13.1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants