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

Option for replacing the zero instead of a number after the separator #1315

Open iamcoderUA opened 8 months ago

iamcoderUA commented 8 months ago

🚀 Question / feature request

Description

Context: the "separator/separator.2" mask. Current behavior: The user submits the initial value, e.g. "0.15". Later on, the User decides to change the value to "2.15". The User would have to put the cursor before the zero, enter the "2" and delete the zero manually. Otherwise, the User has to completely remove the value and enter a new value. One more thing, when the User puts a cursor after the zero and before the dot, and enters the "2", the initial value "0.15" would change to "0.25".

Describe the solution you'd like

I haven't found a straightforward solution, however, it would be great to have an option where the User could put the cursor after the zero and before the dot, and any entered numbered would replace the zero itself instead of the number following after the dot. Currently, similar expected behavior provides the "percent/percent.2" mask.