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

Regression between 15.0.0 and 15.2.1+ / 16.x.x #1255

Closed varadero closed 7 months ago

varadero commented 1 year ago

🐞 bug report

Is this a regression?

Yes. It works in 15.0.0 but not in 15.2.1 and 16+

Description

It allows typing for example integer values (like 1, 10 or 100) and decimals with 1 digit before and after the point (like 1.2)

It considers integer values (like 1, 10 or 100) as invalid and also decimals with 1 digit after the point (like 1.2)

andriikamaldinov1 commented 1 year ago

@varadero Hi. Could you provide stackblitz ?

marcpearson commented 11 months ago

Same errors for me. An input field set like this

 <input
          type="text"
          formControlName="quantity"
          mask="0*.00"
          [dropSpecialCharacters]="false"
      />

was working fine with version 16.0.2 and now is broken with version 16.3.4. Every field has class ng-invalid when loading a form with value already set in the control. After editing the field with the same value, the field is ng-valid

The problem occur when the initial value set in the control (patchValue) has more decimal than the mask allows (ex 1.2300)

andriikamaldinov1 commented 7 months ago

@marcpearson Thanks for using Ngx-mask. Please update to latest version. It example all work as expected - https://stackblitz.com/edit/stackblitz-starters-o7rqma?file=src%2Fmain.ts

andriikamaldinov1 commented 7 months ago

This issue has been locked due to inactivity. Please file a new issue by teamplate if you are encountering a similar or related problem.