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

KeyFilter pValidateOnly does not accept Null values #5047

Closed
billfranklin opened this issue Feb 1, 2018 · 2 comments
Closed

KeyFilter pValidateOnly does not accept Null values #5047

billfranklin opened this issue Feb 1, 2018 · 2 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@billfranklin
Copy link

I'm submitting a ... (check one with "x")

[x ] bug report => Search github for a similar issue or PR before submitting

**Current behavior**
<!-- Describe how the bug manifests. -->
If you set a pKeyFilter="pnum" on a Reactive Form, and set the Validator.max(99.9999) (probably any value), the formcontrol has error of 'validatePattern' if the value is null or undefined.

**Expected behavior**
<!-- Describe what the behavior would be without the bug. -->
null and undefined should not cause a validatePattern error

PrimeNg Version: 5.2
Angular Version: 5.2.3
@AlejandroFlorin
Copy link

Same issue. But it is inconsistent. It happens with some controls but not others. Also happens with other filter types (int, num, etc.) I haven't found why yet.

@riorudo
Copy link

riorudo commented Mar 27, 2018

It seems that the default masks do not match/allow empty strings (https://github.com/primefaces/primeng/blob/master/src/app/components/keyfilter/keyfilter.ts).
In my case I use my own regex instead of "pint", I use /[\d]|^$/ to match empty strings as well.

@cagataycivici cagataycivici self-assigned this Apr 17, 2018
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working Status: Pending Review Issue or pull request is being reviewed by Core Team labels Apr 17, 2018
@cagataycivici cagataycivici added this to the 5.2.5 milestone Apr 17, 2018
@cagataycivici cagataycivici removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants