Add onClick/onPress to MenuItem #5459
Unanswered
jhowell-droit
asked this question in
Q&A
Replies: 2 comments 8 replies
-
Please see discussion here #5058 (reply in thread) |
Beta Was this translation helpful? Give feedback.
4 replies
-
I'm wondering if there's any updates here? The specific use case I'm looking at is adding event tracking to a |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using React Aria's Menu component to build a popover style menu in my design system. When using it in an application, we need to be able to trigger Javascript when certain menu items are clicked. I notice that there is an
onAction
method for theMenu
component itself but that suggests an event which fires when any of the items are clicked. I would like to be able to effectively add an onClick or onPress event to the individual MenuItems in order to apply different actions to each one. Is this possible? I am wrapping the MenuItem component in my own React component so I have tried spreading an onClick event into the props but this didn't work.Any help would be much appreciated,
Thanks
Beta Was this translation helpful? Give feedback.
All reactions