Ngx-mask: Input stuck after the first digit with dot_separator or comma_separator

Created on 22 Oct 2019  路  5Comments  路  Source: JsDaddy/ngx-mask

When uses the dot_separator or comma_separator, the input stuck after the first digit.

issue-ng-mask

Code in template:
<div class="input-group col-sm-3"> <input formControlName="ce" type="text" mask="dot_separator" class="form-control input-sm" /> <div class="input-group-addon"> % </div> </div>

I imported the module with the forRoot() method (Without the optional parameter).

I'm using angular 7.2.0 with ngx-mask 8.2.0

P1 bug

Most helpful comment

I found a resolution for my problem. I had to use the decimalMarker with thousandSeparador.

<input formControlName="ce" type="text" mask="separator" decimalMarker="," thousandSeparator="." class="form-control input-sm" />

Too bad this information is not in the documentation. I had to look in the source code.

All 5 comments

The readme file is now out of date.
You can use:
mask="separator" thousandSeparator=","
Please see this link:
https://stackblitz.com/edit/ngx-mask-currency-example

Worked!!! Where can I find the up to date documentation?

I don't know if here is the right place to make that question. But, when I set the value in the form with thousandSeparator=".", the decimal separator is ignored. Should I too specify the decimal separator?

image

I found a resolution for my problem. I had to use the decimalMarker with thousandSeparador.

<input formControlName="ce" type="text" mask="separator" decimalMarker="," thousandSeparator="." class="form-control input-sm" />

Too bad this information is not in the documentation. I had to look in the source code.

Had the same issue... all fine with 8.0.0 version - broken with 8.1.x version. This was a breaking change so really should have had a major version increase ;-(

@josevjunior , @MikeOne Hi! In the latest version (8.1.6) comma_separator and dot_separator were removed and documentation was updated. As was noticed, you can add such separator next way: <input type='text' mask="separator" thousandSeparator="," />

Was this page helpful?
0 / 5 - 0 ratings