Describe the bug
The context menu of a tree item can't be opened using the keyboard (context menu key or context menu shortcut), because the (contextmenu) event listener is attached to the wrong element - the <li> is focused, but the event listener is on the <div> inside it.
Pull Request Link
#18254
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://primeng.org/tree#contextmenu
Environment
Angular version
21.x.x
PrimeNG version
v21
Node version
No response
Browser(s)
all
Steps to reproduce the behavior
- Go to https://primeng.org/tree#contextmenu
- Click a tree item
- Press the context menu key or the context menu shortcut (Shift + F10 in Chrome)
Actual behavior: The browser context menu is opened instead of the tree context menu.
Expected behavior
The tree context menu is opened.
Describe the bug
The context menu of a tree item can't be opened using the keyboard (context menu key or context menu shortcut), because the
(contextmenu)event listener is attached to the wrong element - the<li>is focused, but the event listener is on the<div>inside it.Pull Request Link
#18254
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://primeng.org/tree#contextmenu
Environment
Angular version
21.x.x
PrimeNG version
v21
Node version
No response
Browser(s)
all
Steps to reproduce the behavior
Actual behavior: The browser context menu is opened instead of the tree context menu.
Expected behavior
The tree context menu is opened.