primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Filter is not working in ListBox Component and Dropdown Component with SelectItem type

Open AlbaSS18 opened this issue 1 year ago • 1 comments

Describe the bug

When options are SelectItem type, filter is not working in ListBox and Dropdown Component.

Listbox options: imagen

Filter options: imagen

Environment

Ubuntu 20.04.6 LTS

Reproducer

https://stackblitz.com/edit/j5s22b?file=src%2Fapp%2Flistbox-filter-demo.html

Angular version

17.3.11 or 18.0.1

PrimeNG version

17.18.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.13.0

Browser(s)

Firefox 126

Steps to reproduce the behavior

No response

Expected behavior

No response

AlbaSS18 avatar Jun 19 '24 12:06 AlbaSS18

Same observation in my code using ListBox with filter and SelectItem array as options

[email protected]

@angular/[email protected] [email protected]

quartelh avatar Jun 24 '24 13:06 quartelh

Hi,

SelectItem type is not related to the listbox component's internal logic. To use filter functionality, you should provide a filterField or optionLabel property.

I am closing the issue since it's not a bug.

cetincakiroglu avatar Jul 04 '24 08:07 cetincakiroglu

Okey, thank you. In previous versions, filterField or optionLabel property with SelectItem was not necessary, so I don't understand because now it is necessary.

AlbaSS18 avatar Jul 04 '24 11:07 AlbaSS18

I am confused. The behaviour for Dropdown is different than for ListBox.

See https://stackblitz.com/edit/j5s22b-iaamnd.

For Dropdown it just works and there is no need for filterFields or optionLabel property for the filter to just work with SelectItem.

quartelh avatar Jul 11 '24 09:07 quartelh