-
Notifications
You must be signed in to change notification settings - Fork 5k
p-menu popup breaks when appendTo="body" [popup]="true" and routerLink/navigate (overlay doesn't close) #19213
Copy link
Copy link
Closed
Labels
Type: BugIssue contains a bug related to a specific component. Something about the component is not workingIssue contains a bug related to a specific component. Something about the component is not working
Milestone
Description
Describe the bug
When the p-menu has the option appendTo="body" [popup]="true" and the item we're clicking has a routerLink or inside the command a this.router.navigate() or this.router.navigateByUrl() the popup doesn't close and it's shown in the page navigated.
In PrimeNG 20.2.0 it's working perfectly (my last version) in PrimeNG 21 it's not working
The first option of this menu is a routerLink, when I click it, it navigates but the menu doesn't close.
Pull Request Link
No response
Reason for not contributing a PR
- Lack of time
- Unsure how to implement the fix/feature
- Difficulty understanding the codebase
- Other
Other Reason
No response
Reproducer
Environment
Angular version
21
PrimeNG version
v21
Node version
24
Browser(s)
No response
Steps to reproduce the behavior
- Have 2 pages with routing.
- Put a p-menu with
appendTo="body" [popup]="true"and one item with routerLink to the other page. - When Angular navigates to the other pages the menu doesn't close.
Expected behavior
Menu closes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: BugIssue contains a bug related to a specific component. Something about the component is not workingIssue contains a bug related to a specific component. Something about the component is not working
Type
Projects
Status
Done