Skip to content
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

Submenu onClick isn't called #268

Open
Frickitickitavi opened this issue Aug 20, 2024 · 0 comments
Open

Submenu onClick isn't called #268

Frickitickitavi opened this issue Aug 20, 2024 · 0 comments

Comments

@Frickitickitavi
Copy link

Frickitickitavi commented Aug 20, 2024

I want to have a menu with a list of options to choose from, and for hovering over each of those options to bring up some extra details about the option in question. I want the user to be able to select an option either by selecting the option itself in the top menu or by clicking the details popup.

So I have a Menu with a Submenu for each option, and each Submenu contains a single Item that displays the details about the option. For each pair of Submenu and Item, they both use the same exact onClick prop to handle the selection, but the one in the Submenu gets ignored. I've tried using e.preventDefault and e.stopPropagation to get around whatever's blocking the Submenu from executing my code, but nothing seems to work.

Is there a way I can achieve this? I'm sure I can get the same effect through some completely different approach (toggling visibility of details with onMouseOver for an Item or something), but this felt like an elegant way to do it and I'm surprised that it doesn't seem to be working.

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

1 participant