Skip to content

HTML element under the menu is clicked when the menu item is selected #7996

@kristo

Description

@kristo

Provide a general summary of the issue here

we already had issues related to the onPress handler which the last release seemed to fix, but not completely. our new example shows that by opening a menu over an html element with an onclick handler, it can be still triggered by clicking the menu item.

link to a small example where you can repeat the behavior:
https://r6grtm.csb.app/

🤔 Expected Behavior?

onClick handler should not be triggered when clicking menu item

😯 Current Behavior

onClick handler of the "black" div is triggered when clicking menu item

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

open https://r6grtm.csb.app/
turn on developer tools, click Toggle Device Toolbar
choose Responsive - Mobile mode
click "hamburger menu" icon
click on one of the menu items
onClick handler (alert) is fired

Version

react-aria-components 1.7.1

What browsers are you seeing the problem on?

Chrome Version 134.0.6998.89 (Official Build) (arm64)

If other, please specify.

No response

What operating system are you using?

MacOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions