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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple masks with copy and paste input #1365

Open
weilinzung opened this issue May 10, 2024 · 0 comments
Open

Multiple masks with copy and paste input #1365

weilinzung opened this issue May 10, 2024 · 0 comments

Comments

@weilinzung
Copy link

weilinzung commented May 10, 2024

馃悶 bug report

Is this a regression?

N/A

Description

  • When it has multiple masks, using copy and pate will return an incorrect masked value
  • I noticed that removing the space between S0S 0S0 => S0S0S0 will fix the issue, but that is not what we are looking for
  • the same issue of the demo if I change from mask="00||SS" to mask="00||S0 S"
  • "ngx-mask": "^17.0.8"
  <mat-form-field>
    <mat-label>Enter your area code</mat-label>
    <input
      matInput
      placeholder="10001 or M5A 1D3"
      [formControl]="areaCode"
      [mask]="'00000||S0S 0S0'"
      type="text"
      required
    />
  </mat-form-field>

馃敩 Minimal Reproduction

https://stackblitz.com/edit/y6guau?file=src%2Fexample%2Fform-field-error-example.html

馃敟 Exception or Error

We are expecting the masked value with space in between, and the multiple masks should either mask value for US zip code or Canada postal code format => '00000||S0S 0S0.

馃實 Your Environment

Angular Version: 17.3.0

Angular CLI: 17.3.0
Node: 18.18.0
Package Manager: yarn 1.22.19
OS: linux x64

Angular: 17.3.0
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1703.0
@angular-devkit/build-angular      17.3.0
@angular-devkit/core               17.3.0
@angular-devkit/schematics         17.3.0
@angular/cdk                       17.3.6
@angular/material                  17.3.6
@angular/material-experimental     17.3.6
@angular/material-moment-adapter   17.3.6
@schematics/angular                17.3.0
rxjs                               7.4.0
typescript                         5.4.2
zone.js                            0.14.0
    
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