Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BGBRWR opened this issue Nov 5, 2024 · 1 comment
Closed

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

BGBRWR opened this issue Nov 5, 2024 · 1 comment
Assignees

Comments

@BGBRWR
Copy link
Contributor

BGBRWR commented Nov 5, 2024

🐞 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.

@BGBRWR BGBRWR changed the title Changing "hiddenInput" breaks the entered value again Changing "hiddenInput" breaks the entered value (again) Nov 5, 2024
@andriikamaldinov1 andriikamaldinov1 self-assigned this Nov 8, 2024
@andriikamaldinov1
Copy link
Collaborator

@BGBRWR
Thanks for using Ngx-mask. Please update to latest version.
It example all work as expected - https://stackblitz.com/edit/stackblitz-starters-6smr1z?file=package.json

BGBRWR added a commit to BGBRWR/ngx-mask that referenced this issue Nov 27, 2024
BGBRWR added a commit to BGBRWR/ngx-mask that referenced this issue Dec 2, 2024
andriikamaldinov1 added a commit that referenced this issue Dec 5, 2024
Changing hidden input breaks the entered value again #1449
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants