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

Dropdown: filterBy not working. #14235

Closed
castrovini85 opened this issue Nov 28, 2023 · 3 comments
Closed

Dropdown: filterBy not working. #14235

castrovini85 opened this issue Nov 28, 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

Comments

@castrovini85
Copy link

Describe the bug

After setting which property I want to filter from, the component still uses the label.

Environment

I saw it on my localhost and was able to reproduce it on stackblitz.

Reproducer

https://stackblitz.com/edit/nqejfj-qma9qg?file=src%2Fapp%2Fdemo%2Fdropdown-filter-demo.ts

Angular version

17.0.0

PrimeNG version

17.0.0-beta.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20

Browser(s)

No response

Steps to reproduce the behavior

Here I add the filterText property to the countries example from the website.
image

I also changed the filterBy option on the HTML
image

When I search for '1' or '2', nothing shows up
image
image

If I search by anything that matches the labels, it is filtering
image

Expected behavior

After setting the filterBy to a property of the object, it should be filtering by it, not the label.

@castrovini85 castrovini85 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 28, 2023
@castrovini85
Copy link
Author

I just tested id on version 15.4.13-lts and it works fine there
https://stackblitz.com/edit/yhz7yr?file=src%2Fapp%2Fdemo%2Fdropdown-filter-demo.ts

@ashikjs
Copy link
Contributor

ashikjs commented Nov 29, 2023

@castrovini85 you missed the documentation checked here https://primeng.org/dropdown#api.dropdown.props.filterFields

you have to mention filterFields with array like this. [filterFields]="['filterText']"

you can check it here, https://stackblitz.com/edit/nqejfj-jpabs9?file=src%2Fapp%2Fdemo%2Fdropdown-filter-demo.ts

@mertsincan
Copy link
Member

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap?
Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

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

3 participants