Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kristo opened this issue Mar 27, 2025 · 1 comment
Closed

Comments

@kristo
Copy link

kristo commented Mar 27, 2025

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

@kristo kristo changed the title HTML element under the menu is clicked when the menu item is clicked HTML element under the menu is clicked when the menu item is selected Mar 27, 2025
@snowystinger
Copy link
Member

Thanks, I think this is a duplicate of onPress Issue - Click Through Component When it Unmounts
lets continue the discussion over there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants