mui / mui/base-ui

[menu][popover] Stop event propagation for `Menu.Popup` `onClick` and `onDoubleClick`

Open
#2,195 1 comment 0 reactions 0 assignees View on GitHub
component: dialog component: menu component: popover has workaround
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

# Bug report

## Current behavior

Events from interactions with popups bubble up, which may trigger handlers attached to parent element.

## Expected behavior

The popup should stop event propagation to prevent unintended side effects.

## Reproducible example

https://codesandbox.io/p/sandbox/9jhghq

## Base UI version

beta-1.0.0-beta.0

## Which browser are you using?

Chrome

## Which OS are you using?

Mac OS

## Which assistive tech are you using (if applicable)?

-

## Additional context

In my case I encountered a problem when I had onclick and ondoubleclick handlers somewhere on the parent. Before that I used `Menu` from @mui and everything worked as expected. I think it's worth preventing at least these two events by default.

Workaround - assign handlers with `event.stopPropagation()` manually.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.