Skip to content

[AnalyticalTable]: onRowClick runs when clicking menu option #7516

@fernandademery

Description

@fernandademery

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

  1. Load the app in stackblitz
  2. Open the console
  3. Click on the "overflow" icon button
  4. Click the MenuItem
  5. 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

No one assigned

    Labels

    Projects

    Status

    2025-Q3

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions