ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

Reactive Forms Decimal Mask Issue when data type is Number

Open tapoinde opened this issue 6 years ago • 2 comments

I see an issue when using reactive forms and using decimals. If the initial value is a string, the input works correctly. However, if the initial value is a Number, the behavior changes.

When a string, you are allowed to type 0.1 in order, everything seems to be OK.

When a Number, if the first digit is 0, it will reverse your entry. For example, entering 0.1 results in 1.0.

Example: https://stackblitz.com/edit/angular-qvvr2w

tapoinde avatar Apr 29 '20 15:04 tapoinde

Setting the input type to number fixed this for me

acurrieclark avatar May 13 '20 11:05 acurrieclark

@tapoinde Thanks for your using Ngx-Mask. Please update to latest version. It example, all work as expected - https://stackblitz.com/edit/angular-9t76kf?file=src%2Fmain.ts

andriikamaldinov1 avatar Jun 13 '23 11:06 andriikamaldinov1