Skip to content

OnClick event from wrapper is fired when clicking inside Dialog #2312

@marcojacobsNL

Description

@marcojacobsNL

Bug report

Current behavior

In our current app we have a timeline message that is wrapped in a div element that contains an onClick to open our message dialog. Within this timeline message, we also have buttons that can open other dialogs such as 1 to see the people that liked the message. With this setup though, were encountering an issue that when you click on one of the buttons to open let's say the Likes dialog after clicking within that dialog, the onClick from the wrapping element is fired and it opens the message Dialog.
It seems to also happen when we wrap the timeline message in an <a> tag, and the link is opened after clicking inside of the Likes dialog. Using the ESC seems to work fine, it's just clicks

Expected behavior

The onClick from the wrapping element should not be fired anymore.

Reproducible example

https://codesandbox.io/p/sandbox/twilight-worker-fyr52x

Base UI version

Latest version

Which browser are you using?

FireFox

Which OS are you using?

Mac OS

Additional context

Since Base-UI uses Floating-UI, I also opened a issue on their Github
floating-ui/floating-ui#3363

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions