Closed tiago-eusebio-dev closed 1 year ago
@tiago-eusebio-dev Thanks for using Ngx-Mask. Please update to latest version. It example all work as expected - https://stackblitz.com/edit/ngx-time-gwqnkt?file=src%2Fmain.ts
@andriikamaldinov1 Thank you. I confirm that it is fixed now.
On a side note, do you have any comment about having to escape the 'S' character? Shouldn't this be treated by ngx-mask itself?
🐞 bug report
Is this a regression?
No.
Description
I have a complex duration input with the
00D : 00H : 00M : 00S
mask, on which the user can only enter digits. I have defined each of the mask's non-digit characters asspecialCharacters
and created custompatterns
for each of them so the user cannot write over them (snippet below). The bug is that when pressing thebackspace
key on the "H" or "D" character, the mask's "M" character is replaced with a 0. When using another character in the place of the "M" (eg.: "Y"), the issue doesn't happen.Press backspace here:
Result:
🔬 Minimal Reproduction
Stackblitz demo: https://stackblitz.com/edit/ngx-time?file=src%2Fmain.ts
🔥 Exception or Error
None.
🌍 Your Environment
Angular CLI: 16.2.6 Node: 16.20.2 ngx-mask: 16.3.9
Anything else relevant?
I had to escape the "S" character otherwise it wouldn't work. I think it is another bug when replacing characters.