-
Notifications
You must be signed in to change notification settings - Fork 105
Description
Describe the bug
We are using a @ui5/webcomponents-react Menu component for an action column in AnalyticalTable. Since upgrading to V2, the click event in the MenuItem bubbles and triggers an onRowClick event. Using event.stopPropagation() on the MenuItem click handler doesn't prevent the bubbling, so we needed to include a workaround in the table row click handler to account for this possibility. I would like to know if this new behavior is intended or if it is a bug when handling the UI5 custom event.
If this is how you expect the menu items click events to behave, I would like to know if there is a recommended best practice for when the Menu is placed within another component that can also hold a click event, such as a table row.
Isolated Example
https://stackblitz.com/edit/vitejs-vite-cx3kv641?file=README.md
Reproduction steps
- Load the app in stackblitz
- Open the console
- Click on the "overflow" icon button
- Click the MenuItem
- Check that, in the console, there's a log from the MenuItem click function and another one that comes from the onRowClick function
...
Expected Behaviour
If the MenuItem is clicked and event.stopPropagation() is set, the click should not bubble to the table row.
Screenshots or Videos
No response
UI5 Web Components for React Version
2.9.2
UI5 Web Components Version
2.9.0
Browser
Chrome
Operating System
No response
Additional Context
No response
Relevant log output
Organization
No response
Declaration
- I’m not disclosing any internal or sensitive information.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status