Filter is not working in ListBox Component and Dropdown Component with SelectItem type
Describe the bug
When options are SelectItem type, filter is not working in ListBox and Dropdown Component.
Listbox options:
Filter options:
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
Same observation in my code using ListBox with filter and SelectItem array as options
@angular/[email protected] [email protected]
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.
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.
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.