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

multiselect: filter not working #14835

Closed
capc0 opened this issue Feb 19, 2024 · 0 comments · Fixed by #14874
Closed

multiselect: filter not working #14835

capc0 opened this issue Feb 19, 2024 · 0 comments · Fixed by #14874
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@capc0
Copy link
Contributor

capc0 commented Feb 19, 2024

Describe the bug

The multiselect filter is not working anymore when the options passed to the component are class based (e.g. instances of a class named City).

image

The bug was introducted with this commit ed2c867

The check for ObjectUtils.isObject(options[0]) fails for class based options, since options[0].constructor === Object evaluates to false.

Environment

see below

Reproducer

https://stackblitz.com/edit/github-97dcah?file=src%2Fapp%2Fapp.component.ts

Angular version

17.1.2

PrimeNG version

17.7.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18

Browser(s)

No response

Steps to reproduce the behavior

  1. open the stackblitz
  2. open the multiselect overlay
  3. type something into the filter
  4. see the console output

Expected behavior

filter should also work with class based objects

@capc0 capc0 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 19, 2024
capc0 added a commit to capc0/primeng-14835 that referenced this issue Feb 26, 2024
@mehmetcetin01140 mehmetcetin01140 added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 26, 2024
@mehmetcetin01140 mehmetcetin01140 added this to the 17.9.0 milestone Feb 26, 2024
@mehmetcetin01140 mehmetcetin01140 self-assigned this Feb 26, 2024
cetincakiroglu added a commit that referenced this issue Feb 28, 2024
fix isObject detection (closes #14835)
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
2 participants