-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
ContextMenu - does NOT remove from the DOM after router.navigate action #13949
Comments
Link to Discussion thread where lead PrimeNG Angular developer has confirmed the bug: https://github.com/orgs/primefaces/discussions/161 |
I am pretty sure that the context menu with |
@cetincakiroglu, [email protected] update: I can confirm that when I open Console error: Debugger stack trace: The problem is here:
It's an error on your side guys. IMPORTANT: I also do not understand why p-contextMenu has Take me seriously please, I'm using PrimeNG for 6 years already without any issues and single bug. Thanks in advance, |
Hi, Thanks a lot for reporting the issue, we'll address this in 16.9.0 release within 1-2 days |
Describe the bug
After routing to another page on clicking on one (command property) ContextMenu item - it does NOT work properly to me. ContextMenu is not removed from the DOM after we route to another page in the Angular app.
First video (I set display: block !important to disable PrimeNG display: none bug), router navigate on command property does not work:
Video: https://github.com/primefaces/community/assets/17203747/2e972334-ebb7-4340-bf53-1e37e8b996b3
Second video (I do not override any PrimeNG CSS, issue with display: none CSS by PrimeNG 16 can be seen here), I'm clicking right mouse button to open up context menu:
2023-10-02.10-00-02.mp4
The only change what I've done (temporarily on PrimeNG 16 because of a bug) in the video to original ContextMenu CSS is that I set manually
display: block !important;
because contextMenu has display: none set by default on.p-contextmenu
CSS class even when user clicks on the contextMenu. So originally, we can NOT see ContextMenu because PrimeNG hides it withdisplay: none.
So there are two bugs:
command
property in the[model]
array of contextMenu)This has always worked in versions up to PrimeNG 15. Now on PrimeNG 16 I think that bug has been introduced. I did not change any code of PrimeNG in meantime.
Stackblitz: https://stackblitz.com/edit/5lxh8n?file=src%2Fapp%2Fdemo%2Fcontext-menu-basic-demo.html,src%2Fapp%2Fdemo%2Fcontext-menu-basic-demo.ts
There's an obvious bug with
p-contextMenu
not being removed from the DOM, when user right clicks (and routes to other page -command
property) on any row of thep-table
.State of
p-contextMenu
aftercommand
action (route activation),p-contextMenu
shouldn't be in the DOM:I'm available for more demonstration or explanation. I am also available for checking PrimeNG codebase to see where issue was introduced.
Kind regards,
Robert Medved
--
Issue is persistent on: PrimeNG - version 16.5.0, browser cache has been cleared by me after updating new version.
I'm available for more demonstration or explanation.
Environment
Windows + Chrome
Reproducer
https://stackblitz.com/edit/5lxh8n?file=src%2Fapp%2Fdemo%2Fcontext-menu-basic-demo.html,src%2Fapp%2Fdemo%2Fcontext-menu-basic-demo.ts
Angular version
16.2.0
PrimeNG version
16.5.0
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
p-table
p-contextMenu
command
action (route to another page)p-contextMenu
is still in the DOM - component is not being destroyed aftercommand
actionExpected behavior
p-contextMenu
should be destroyed from the DOM after user does command action=clicks onp-contextMenu
item (routes to another page).The text was updated successfully, but these errors were encountered: