-
Notifications
You must be signed in to change notification settings - Fork 299
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
Deleting 5 after entering say 500 causes everything to be deleted #1355
Comments
It looks like the check to see if a decimal separator needs to be added needs an additional check to see if it's a zero, otherwise it adds a second decimal - this then causes issues when the later formatters run. The same issue occurs for any number where the next digit is a zero (505,000 for example becomes 0.50 when you delete the first 5). This seems to fix it:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
馃悶 bug report
Is this a regression?
Not sure
Description
Deleting first number where the number is in the hundreds causes the whole number to be deleted apart from 0. This is not the case for example where the number is in the thousands
馃敩 Minimal Reproduction
Using your own example https://jsdaddy.github.io/ngx-mask/#1 where the mask is set to 'separator.2' for example, enter the number 500 then delete the first number 5. You will see that the whole number is deleted leaving just 0.
If you try the same for 5000 then only the number 5 is deleted as expected
Also if you try 555 and delete the first 5 then this also works as expected
Anything else relevant?
I've tried in both Chrome and Edge on a Mac
The text was updated successfully, but these errors were encountered: