Skip to content

Changing "hiddenInput" breaks the entered value (again)Β #1449

@BGBRWR

Description

@BGBRWR

🐞 bug report

Is this a regression?

Yes, the previous version in which this bug was not present was: 18.0.0

Description

When used a mask which hides entered values fully or partially there is a bug when you switch the hiddenInput value. If the value is entered when hiddenInput is true, then when turning it off we lose all but the last typed value. If the inverse and hiddenInput was false and then turned on the value stays intact.

It only happens on type (keydown). You can set the value programmaticly or via paste and it will work.

πŸ”¬ Minimal Reproduction

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

🌍 Your Environment

Angular Version:


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 18.2.11
Node: 20.12.1
Package Manager: npm 10.8.2
OS: win32 x64

Anything else relevant?

This was fixed last year with this issue #1008.

This commit (3c818dc#diff-1198ef06aa3895ce10c29918343a334a7562f988bcef000720b6acb6b70fd0caL81-R83) is what is causing this bug.

Here is the blame: https://github.com/JsDaddy/ngx-mask/blame/0bf5c93064885ed394f526d14ad23c3f8beb9e8e/projects/ngx-mask-lib/src/lib/ngx-mask.service.ts#L83.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions