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

Mask pipe does not correctly render with hidden input #932

Closed
rub-sky opened this issue Sep 24, 2021 · 2 comments
Closed

Mask pipe does not correctly render with hidden input #932

rub-sky opened this issue Sep 24, 2021 · 2 comments
Labels

Comments

@rub-sky
Copy link

rub-sky commented Sep 24, 2021

🐞 bug report

Is this a regression?

No. I am not aware that this worked in previous versions.

Description

When using a custom pattern that has a symbol that is to hide some of the input, the mask pipe does not hide any of the characters even if the hiddenInput value is set to true globally.

Configuration

  public readonly SSN_MASK = 'AAA - AA - 0000';
  public readonly SSN_PATTERNS: IConfig['patterns'] = {
    0: { pattern: new RegExp('\\d')},
    A: { pattern: new RegExp('\\d'), symbol: '●' },
  };

Template code

This is the use in the template:

<span>{{ ssnValue | mask: [SSN_MASK, SSN_PATTERNS] }}</span>

Results

For input 123456789,
the expected output is ●●● - ●● - 6789,
but actual output is 123 - 45 - 6789.

The pipe does not allow hiddenInput configuration, and so will never go down the branch to format the text with the hidden characters.

🔬 Minimal Reproduction

https://stackblitz.com/edit/angular-ivy-r2cy7e?file=src/app/app.component.html

🔥 Exception or Error

None, just unexpected behavior.

🌍 Your Environment

Angular Version:

  "dependencies": {
    "@angular/animations": "12.2.0",
    "@angular/common": "12.2.0",
    "@angular/compiler": "12.2.0",
    "@angular/core": "12.2.0",
    "@angular/forms": "12.2.0",
    "@angular/platform-browser": "12.2.0",
    "@angular/platform-browser-dynamic": "12.2.0",
    "@angular/router": "12.2.0",
    "ngx-mask": "^12.0.0",
    "rxjs": "^7.3.0",
    "tslib": "^2.3.1",
    "zone.js": "^0.11.4"
  }

Anything else relevant?

@DanielNovaesDias
Copy link

Same issue here.

@andriikamaldinov1
Copy link
Collaborator

@rub-sky @LeinadAsid Thanks for your using Ngx-Mask. Please update to latest version.
It example, all work as expected - https://stackblitz.com/edit/angular-wjyfaj?file=src%2Fmain.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

4 participants