I'm not sure if this is a bug or a design decision, but I'd like to have single-decimal auto-completion when no decimal was entered and an input loses focus.
I'm using mask="separator.1" and [leadZero]="true". So, if I type "1" in the input and click/tab out, nothing happens currently. My goal is to have the input value changed to "1.0" in this scenario. (Auto-completion works with mask="separator.2", mask="separator.3", etc.)
This is my first time looking through the source, but it seems like this might be an intentional design decision (if this is indeed is the right spot) as you're checking to see if Number(separatorPrecision) > 1:
π bug report
Description
I'm not sure if this is a bug or a design decision, but I'd like to have single-decimal auto-completion when no decimal was entered and an input loses focus.
I'm using
mask="separator.1"
and[leadZero]="true"
. So, if I type "1" in the input and click/tab out, nothing happens currently. My goal is to have the input value changed to "1.0" in this scenario. (Auto-completion works withmask="separator.2"
,mask="separator.3"
, etc.)This is my first time looking through the source, but it seems like this might be an intentional design decision (if this is indeed is the right spot) as you're checking to see if
Number(separatorPrecision) > 1
:https://github.com/JsDaddy/ngx-mask/blob/develop/projects/ngx-mask-lib/src/lib/ngx-mask.service.ts#L714C13-L716C62
π¬ Minimal Reproduction
<input mask="separator.1" [leadZero]="true" />
https://stackblitz.com/edit/angular-pft6dj?file=src%2Fmain.ts
π Your Environment
Angular Version:
16.2.12
ngx-mask Version:
16.4.2