JsDaddy / ngx-mask

Angular Plugin to make masks on form fields and html elements.
https://jsdaddy.github.io/ngx-mask
MIT License
1.15k stars 298 forks source link

Not possible to use backspace on first separator #1378

Closed irudji closed 2 months ago

irudji commented 3 months ago

Description

I have found bug which occur when using separator mask with different decimal marker than dot.

For example:

When you enter to text input this number

1 234 567,89

then when you place cursor before number 5 and press backspace, then cursor jumps one place left behind the number 4. It is OK for me. But when you place cursor before the number 2 and press backspace then nothing happens and cursor stay on the same place. I think that it should jump one place left behind the number 1.

And anyway it happens in case, that number is 1 234 456 789,14. But it happens only in place of first separator. All others are ok.

I found that this is relevant for all newer versions of ngx-mask from version 13.2.2

andriikamaldinov1 commented 2 months ago

@irudji Thanks for using Ngx-mask. Please update to latest version. It example all work as expected - https://stackblitz.com/edit/angular-17-starter-project-keqhsc?file=src%2Fmain.ts

maaso commented 2 months ago

Hi @andriikamaldinov1,

I'm running into this as well; if you change the thousandSeparator to . in the example you linked, backspace on the first separator does not work anymore.

andriikamaldinov1 commented 2 months ago

@maaso Thanks for using Ngx-mask. Please update to latest version. It example all work as expected - https://stackblitz.com/edit/angular-17-starter-project-mckvl3?file=src%2Fmain.ts