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

When mask change we lose spaces #1262

Closed walkadaw closed 10 months ago

walkadaw commented 11 months ago

🐞 bug report

Description

We have custom pattern. When control has value with space, and mask dynamically changed, we lose space in formControl(but it looks good at input).

input: some value with space
formControlValue: somevaluewithspace

Expected:

input: some value with space
formControlValue: some value with space

See stackblitz example.

🔬 Minimal Reproduction

https://stackblitz.com/edit/stackblitz-starters-woqdps?file=src%2Fmain.ts

🌍 Your Environment

Angular Version:


Angular CLI: 16.1.4
Node: 18.12.1
Package Manager: npm 8.18.0
OS: win32 x64

Angular: 16.0.3
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1601.4
@angular-devkit/build-angular   16.2.0
@angular-devkit/core            16.1.4
@angular-devkit/schematics      16.1.4
@angular/cli                    16.1.4
@schematics/angular             16.1.4
ng-packagr                      16.0.1
rxjs                            7.8.1
typescript                      5.0.4
andriikamaldinov1 commented 10 months ago

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