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

Component: KeyFilter #13076

Closed
PointSingularity opened this issue May 22, 2023 · 3 comments
Closed

Component: KeyFilter #13076

PointSingularity opened this issue May 22, 2023 · 3 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Milestone

Comments

@PointSingularity
Copy link

PointSingularity commented May 22, 2023

Describe the bug

pKeyFilter only accepts strings and no RegExp values.

In PrimeNG version 15 this worked:
ipv4RegEx = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/;
template:

          <input
            class="w-44 text-center"
            id="extDevIp"
            [pKeyFilter]="ipv4RegEx"
            [pValidateOnly]="true"
            pInputText
            type="text"
            formControlName="ip"
            placeholder="0.0.0.0"
          />

If I try to do this in 16 or if I convert it to string, it doesn't work:
ipv4RegEx = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/.toString();

But if I just cast the type, it works again, functionality wise too:
ipv4RegEx = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/ as unknown as string;

Environment

Windows 10,
Node: 18.16.0,
npm: 9.6.6,
Using NX version 16.2.1

Reproducer

No response

Angular version

16.0.2

PrimeNG version

16.0.0-rc.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.0

Browser(s)

Chrome 113.0.5672.127

Expected behavior

pKeyFilter to accept strings and RegExp values.

@PointSingularity PointSingularity added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 22, 2023
@cetincakiroglu cetincakiroglu added this to the 16.0.0 milestone May 22, 2023
@chaeller
Copy link

chaeller commented May 22, 2023

I have the same problem. See https://stackblitz.com/edit/angular-qf6a7r?file=src%2Fmain.ts

@PointSingularity
Copy link
Author

This should be fixed by #13087.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

4 participants