JsDaddy / ngx-mask

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

How to prevent user from add a new decimal marker when it already exists? #1250

Open herickwilke opened 1 year ago

herickwilke commented 1 year ago

🐞 bug report

Description

Let's say I have the number 15.000,53 in my input (thousand separator as dot, comma as decimal), and I put a new comma between 1 and 5, the number gonna change completely. The input will read it as 1,5 and delete numbers. Please watch the following video:

🔬 Minimal Reproduction

https://stackblitz.com/edit/stackblitz-starters-gqxumq?file=src%2Fapp%2Fnumber-input%2Fnumber-input.component.html

https://github.com/JsDaddy/ngx-mask/assets/47700306/c0a37889-2438-4751-912a-9852deebfda6

🌍 Your Environment

Browser: Google Chrome Ngx-mask version: 16.3.4 Angular version: 16.2.4

Thanks.