p-listbox: Can't select an item if the list of options is provided by a function #16083
Labels
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Describe the bug
The listbox component doesn't allow you to select an item, if the list of options in the listbox is provided by a getter function.
Additionally (and this may be part of the issue) I've noticed that when hovering over items in the listbox, something is forcing change detection to fire on the component containing the listbox.
Environment
Windows 11, VSCode 1.91.1
Reproducer
https://stackblitz.com/edit/dfawkv-p1uc9r?file=src%2Fapp%2Flistbox-basic-demo.ts
Angular version
17.3.12
PrimeNG version
17.18.5
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.20.3
Browser(s)
Chrome 126.0.6478.182
Steps to reproduce the behavior
1.) Hover over the listbox items in the reproduction Stackblitz instance. You'll note that the 'Getting options for listbox' log message repeats.
2.) Attempt to click on one of the items. The listbox doesn't acknowledge a selection.
Expected behavior
The repeated change detection SHOULD NOT occur when simply hovering over a list box item.
Additionally, I should be able to trigger a selection with my mouse.
The text was updated successfully, but these errors were encountered: