primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.43k stars 4.6k forks source link

pDropdown: not working properly inside pOverlayPanel #16124

Open ahaller-billtrust opened 3 months ago

ahaller-billtrust commented 3 months ago

Describe the bug

When opening a dropdown inside an overlay panel and selecting a value from the dropdown, the overlay panel unexpectedly closes.

Note: This only happens when setting the appendTo="body" property for the dropdown.

Steps to Reproduce

  1. Open the demo: https://stackblitz.com/edit/k9fw6g?file=src%2Fapp%2Fdropdown-basic-demo.html
  2. Open the overlay panel.
  3. Inside the overlay panel, locate and open the dropdown menu.
  4. Select any value from the dropdown menu.

Expected Behavior The overlay panel should remain open after selecting a value from the dropdown.

Actual Behavior The overlay panel closes immediately after selecting a value from the dropdown.

Environment

Browser: Chrome OS: Windows 10

Reproducer

https://stackblitz.com/edit/k9fw6g?file=src%2Fapp%2Fdropdown-basic-demo.html

Angular version

18.0.1

PrimeNG version

17.18.6

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.20.4

Browser(s)

Chrome 127

Steps to reproduce the behavior

  1. Open the demo: https://stackblitz.com/edit/k9fw6g?file=src%2Fapp%2Fdropdown-basic-demo.html
  2. Open the overlay panel.
  3. Inside the overlay panel, locate and open the dropdown menu.
  4. Select any value from the dropdown menu.

Expected behavior

The overlay panel should remain open after selecting a value from the dropdown.

mehmetcetin01140 commented 3 months ago

Hi @ahaller-billtrust ,

I’ve provided a StackBlitz example for you. You can achieve the expected behavior using the method shown in the example.

Example: https://stackblitz.com/edit/k9fw6g-wuune9?file=src%2Fapp%2Fdropdown-basic-demo.html

ahaller-billtrust commented 3 months ago

thank you for the workaround @mehmetcetin01140 !

ahaller-billtrust commented 1 month ago

the issue still happens (even with @mehmetcetin01140 workaround) and latest PrimeNg 17.18.10.

https://github.com/user-attachments/assets/2d5a4780-5533-4409-ab9c-6670d9187727

ahaller-billtrust commented 4 weeks ago

any updates?