Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay Panel: Interaction with components inside panel template cause panel to hide #14323

Closed
simoneraffaelli opened this issue Dec 11, 2023 · 10 comments · Fixed by #14419
Closed
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@simoneraffaelli
Copy link

Describe the bug

If I deselect a value from a dropdown or a checkbox the panel hides

Environment

PrimeNG@16.9.1
Angular@16.2.0

Reproducer

https://stackblitz.com/edit/gd88qz?file=src%2Fapp%2Fdemo%2Foverlay-panel-basic-demo.html

Angular version

16.2.0

PrimeNG version

16.9.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.0

Browser(s)

Chrome, Firefox

Steps to reproduce the behavior

  1. Click on Show button to open the panel
  2. Select and deselect the checkbox or a value inside the dropdown

Expected behavior

Well I expect the panel to close only if I click outside the panel itself, I click the close icon or i press the esc button on my keyboard

@simoneraffaelli simoneraffaelli added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 11, 2023
@simoneraffaelli simoneraffaelli changed the title Overlay Panel: Interact with components inside panel template cause panel to hide Overlay Panel: Interaction with components inside panel template cause panel to hide Dec 11, 2023
@simoneraffaelli
Copy link
Author

I think is the same as : #14177

@roman-balzer
Copy link

roman-balzer commented Dec 11, 2023

#14120 (comment) for those that search a workaround

Bug also present in v17

@simoneraffaelli
Copy link
Author

simoneraffaelli commented Dec 12, 2023

Well that is not properly a workaround as you don't have the possibility to dismiss the panel by clicking outside of it.... I made some trials and I ended up using event.stopPropagation that in my case I think is the best solution (waiting for a proper bugfix by primeng team).
Here's the stackblitz: https://stackblitz.com/edit/gd88qz-t1zpxd?file=src%2Fapp%2Fdemo%2Foverlay-panel-basic-demo.html (See the onChange methods)
afaik is all working normally but this need more testing to be sure not to loose anything

@simoneraffaelli
Copy link
Author

simoneraffaelli commented Dec 14, 2023

This problem is still present if you click the clear icon on the dropdown or if you uncheck the combobox, you can check in the original stack blitz updating primeng version

@basvandenberg
Copy link

Same issue here, with a dropdown in a overlay-panel with appendTo="body", clicking the clear icon in the dropdown closes the overlay panel. Would be great if this could be fixed.

@anlampe
Copy link
Contributor

anlampe commented Dec 15, 2023

A fix was merged and is part of v17.1.0, please have a look: https://stackblitz.com/edit/gd88qz-r9ujpp?file=package.json.

@simoneraffaelli
Copy link
Author

Yesterday I updated primeng version to 17.1.0 on my stackblitz and the problem was still there, but maybe I forgot to run npm i or idk what happend, because, as shown by @anlampe here, I tried again today and actually the clear and the checkbox seems to be working now. The dropdowns with appendTo="body" are still broken though

@basvandenberg
Copy link

@anlampe I tried the demo that you created on stackblitz and both clicking the checkbox and the clear button indeed work, the overlay remains open, that's great. However, the overlay panel still closes when you select an option in the dropdown.

@anlampe
Copy link
Contributor

anlampe commented Dec 15, 2023

Yes, I could reproduce it. Unfortunately, my PR was already 2 months old, when it was merged and it seems there was another conflicting change in the meantime. I'll have another look as soon as I've some free time.

anlampe added a commit to kleinod21/primeng that referenced this issue Dec 21, 2023
@cetincakiroglu cetincakiroglu added this to the 17.3.0 milestone Dec 28, 2023
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 28, 2023
cetincakiroglu added a commit that referenced this issue Dec 28, 2023
…k-event-not-processed-by-overlay

Fix #14323: Dropdown fix regression - options overlay is closed before it handles the click event
@zaslavskyv
Copy link

Fucked up again in 8d69419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
6 participants