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 #1008

Closed
gultyayev opened this issue May 24, 2022 · 7 comments
Closed

Changing "hiddenInput" breaks the entered value #1008

gultyayev opened this issue May 24, 2022 · 7 comments
Labels

Comments

@gultyayev
Copy link

🐞 bug report

Is this a regression?

The bug was introduced by this commit 4dcd683

image

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 a half of the entered value. If instead it was false and then turned on the value stays intact.

🔬 Minimal Reproduction

Was not able to create a reproduction as latest version of the lib isn't working with the latest Angular. But should be smth like it
https://stackblitz.com/edit/angular-ivy-mask-cabthi?file=src%2Fapp%2Fapp.component.ts

🌍 Your Environment

Angular Version: any. Not related to the Angular's version

Anything else relevant?

I discovered that the cause is the line 58 if (this.hiddenInput && !this.writingValue) { of mask.service.ts. If changed to if (this.hiddenInput) { then the issue is not reproducible anymore.

xakeppok pushed a commit that referenced this issue Jun 9, 2022
xakeppok pushed a commit that referenced this issue Jun 10, 2022
NepipenkoIgor pushed a commit that referenced this issue Jun 10, 2022
* fix(#1008): changing hiddenInput breaks the entered value

* fix(#1008): deps

* fix(#1008): update deps, add legacy peer deps

* fix(#1008): update npm install to ci

Co-authored-by: Vladislav <[email protected]>
@xakeppok
Copy link
Collaborator

@gultyaev Thank you that you using ngx-mask . Please try version >=13.1.11

@gultyayev
Copy link
Author

@xakeppok tried [email protected]. Looks like it's not there

@xakeppok
Copy link
Collaborator

@gultyaev sorry. My mistake >=14.0.2

@gultyayev
Copy link
Author

Any chance it could arrive in v13?
14 is not so easy to upgrade to

@rushabh-wadkar
Copy link

Hey @xakeppok We're using ngx-mask@12 version as we are using angular version set to v12. It's not possible for us to upgrade the angular version due to the timelines. Is it possible to fix this issue for version 12 of ngx-mask as a patch version ?

Reproducible link: https://stackblitz.com/edit/test-ngx-mask-6j2szn?file=src%2Fapp%2Fapp.component.html&hideDevTools=1

Step1: Write: 111-1
Step2: Click hide button 

This shows *** instead of ***-*

@NepipenkoIgor NepipenkoIgor reopened this Sep 6, 2023
@rushabh-wadkar
Copy link

@NepipenkoIgor @andriikamaldinov1 Any plans to fix this for v12 ?
Can you atleast provide what changes are needed just to fix this. I have already forked the project. I'll patch this on my own.

@andriikamaldinov1
Copy link
Collaborator

@rushabh-wadkar Thanks for using Ngx-mask. We have added updated version for 12 angular this is 13.2.1
It example all work as exepcted - https://stackblitz.com/edit/base-angular-12-app-hqsdro?file=src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants