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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearing input field in Firefox with backspace key using a mask not clearing input correctly #1350

Open
L-VE opened this issue Apr 15, 2024 · 0 comments

Comments

@L-VE
Copy link

L-VE commented Apr 15, 2024

馃悶 bug report

Description

When selecting the value in an input field using a mask and try to clear it with backspace, the value in the input is not cleared until you enter backspace again.

馃敩 Minimal Reproduction

I created a project in stackblitz to reproduce the issue: https://stackblitz.com/edit/stackblitz-starters-qsudsd
I have an input whose validation errors are shown via a separate custom component.
The input has a mask 000 with a min validator (min 777), so you can only enter a number with 3 digits with a min of 777.
A validation error must be show when the input is invalid and has been touched.

Now when you enter '444' en leave the input and try to select the value and use backspace to clear the value, it's doesn't clear the input value.
The formcontrol value is cleared apparently but the value of the input itself is not. So you have to use backspace again to clear the value.

ngxmask_issue.mp4

We are having this problem since ngx-mask version 12. Everytime we upgrade Angular and ngx-mask we hope this issue is resolved, but it still persists. We also did not find a workaround. The validation must be performed by a seperate generic component that is used throughout our webapp.

馃敟 Exception or Error



The value of the input is only cleared by pressing backspace two times. It should be cleared immediately after the first press.

馃實 Your Environment

Angular Version:



Angular CLI: 17.3.4
Node: 20.11.1
Package Manager: yarn 1.22.19
OS: linux x64
ngx-mask: 17.0.7

Anything else relevant?
Firefox 124.0.2 (64 bit)

We only have this problem in Firefox, in other browsers the clearing of the input works correctly.

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

No branches or pull requests

2 participants