PrimeNG dropdown not properly highlighting selected items when appendTo="body" #12256
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
When a PrimeNG dropdown is defined with appendTo="body" the selected items are not highlighted properly in the "overlay" list of items.
This bug was introduced in v14.2.0
The following movie shows a PrimeNG dropdown working properly and corresponds to a PrimeNG dropdown with appendTo not set:
working3.mov
The following movie shows a PrimeNG dropdown not working properly and corresponds to a PrimeNG dropdown with appendTo="body":
notWorking3.mov
After examining the dropdown source code I was able to locally modify dropdown.ts and fix this bug with the following changes:
Note: I only verified the proposed fix worked on my simple case.
Environment
Mac OS and Windows 10
Reproducer
https://github-xa3pgb.stackblitz.io
Angular version
14.x
PrimeNG version
14.2.x
Build / Runtime
Angular CLI App
Language
ALL
Node version (for AoT issues node --version)
14+
Browser(s)
All
Steps to reproduce the behavior
2.1 Verify that the "hhhh" item is highlighted and visible
3.1 Verify that as you select an item, it is highlighted and is visible
4.1 Verify that the "HHHH" item is not highlighted and not visible
5.1 Verify that as you select an item, only Items AAAA-EEEE are highlighted and are visible
Expected behavior
The navigation of items in a dropdown list with appendTo="body" should work the same as when appendTo is not defined
The text was updated successfully, but these errors were encountered: