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

fix(1358): add trailing zero when mask="separator.1" and leadZero="true" #1359

Closed nathanielbuck closed 4 months ago

nathanielbuck commented 5 months ago

Currently, no trailing zero is added when mask="separator.1" and leadZero="true" and input loses focus. This change adds the trailing zero in that case.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

When mask="separator.1" and leadZero="true", the input's value doesn't change when there is no decimal and the input loses focus. So, if 1 is entered in this case, the value remains 1 but the desired result is that the value would be changed to 1.0.

Issue Number: #1358

What is the new behavior?

When 1 is entered and the input loses focus, the value is replaced with 1.0

Does this PR introduce a breaking change?