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

Component: ContextMenu with appendTo="body" doesn't close when destroyed #13948

Closed
brio1009 opened this issue Oct 24, 2023 · 5 comments · Fixed by #13960
Closed

Component: ContextMenu with appendTo="body" doesn't close when destroyed #13948

brio1009 opened this issue Oct 24, 2023 · 5 comments · Fixed by #13960
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@brio1009
Copy link

Describe the bug

When using a context menu with appendTo="body", the opened context menu stays open even if the context menu component is destroyed/removed.

Environment

Windows + Chrome

Reproducer

https://stackblitz.com/edit/yfrjgh?file=src%2Fapp%2Fdemo%2Fcontext-menu-document-demo.html

Angular version

16.2.0

PrimeNG version

16.5.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.18.0

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to the Stackblitz example
  2. Click Show menu appended to body and Show menu not appended to body. Now, two context menus should be open.
  3. Click Destroy context menu component
  4. Notice that the Appended to body context menu stays open

Expected behavior

The context menu with appendTo="body" should also be removed.

@brio1009 brio1009 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 24, 2023
@eXpertise7
Copy link

@brio1009 This might be related: https://github.com/orgs/primefaces/discussions/161

I'm opening issue for ContextMenu issue now also.

@brio1009
Copy link
Author

Similar to #13949, this issue is probably related to #13936

@maruthumj
Copy link
Contributor

Hi @brio1009 I will work on this.

@maruthumj
Copy link
Contributor

maruthumj commented Oct 27, 2023

@brio1009 In the below video you can see that this issue got resolved by the changes that I have pushed into the linked Pullrequest.
https://github.com/primefaces/primeng/assets/32091483/9789a4af-6373-47fc-a152-5bf070dd628f

@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 Nov 1, 2023
@cetincakiroglu cetincakiroglu added this to the 16.7.0 milestone Nov 1, 2023
cetincakiroglu added a commit that referenced this issue Nov 1, 2023
Bug fix #13948 - ContextMenu with appendTo="body" doesn't close when destroyed
@brio1009
Copy link
Author

brio1009 commented Nov 1, 2023

Thanks for the fast response + fix release :)

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
Development

Successfully merging a pull request may close this issue.

4 participants