Skip to content

Angular 21, signal and showMaskTyped: true has some issues #1590

@flohw

Description

@flohw

🐞 bug report

Is this a regression?

This is a regression, I think.

Description

We use this library in a very large application, with custom inputs.
We used to have the configuration {showMaskTyped: true}, with ngModel, which are used in custom inputs
({providers: [{provide: NG_VALUE_ACCESSOR, multi: true, useExisting => OurComponent, /* somtimes with forwardRef */}]})
We were able to show the mask and the value when typed, no problem.

We are transitioning to signals and provide the configuration at application level (providing it at component level does not affect the behavior)

It seems that the value is overridden by the mask directive and the value is left blank, displaying the mask in the field instead of the original value when providing a default value from a model. Note that the behavior is the same when the variable is not a model but a simple value like value = 65432.

🔬 Minimal Reproduction

https://github.com/flohw/repro-app-ngx-mask

🔥 Exception or Error

None, the value is edited badly and override the default value provided.

🌍 Your Environment

Angular Version: 21


Angular CLI: 8.3.18
Node: 13.1.0
OS: linux x64
Angular: 21.0.8
... common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2100.5
@angular-devkit/core         21.0.5
@angular-devkit/schematics   21.0.5
@angular/build               21.0.5
@angular/cli                 21.0.5
@schematics/angular          21.0.5
@schematics/update           
rxjs                         7.8.2
typescript                   5.9.3

Anything else relevant?
It works outside a NG_VALUE_ACCESSOR input. Hopefully there is a workaround or something from Angular I don't know yet which will fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions