[ActionMenu.Button] onClick doesn't function
Description
When trying to pass a function to ActionMenu.Button it doesn't get invoked.
Steps to reproduce
- Goto: https://primer.style/react/ActionMenu
- Overload
onClickand see it doesn't get invoked on clicking.
Version
^36.19.1
Browser
No response
Uh oh! @DavidMeu, the image you shared is missing helpful alt text. Check your issue body.
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.
Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.
Not an expert on this, but I think the idea is that you'd leverage the onOpenChange property on the ActionMenu, rather than trying to catch the click on the button itself (which already has the behaviour attached to it to open/close the menu).
Not an expert on this, but I think the idea is that you'd leverage the
onOpenChangeproperty on theActionMenu, rather than trying to catch the click on the button itself (which already has the behaviour attached to it to open/close the menu).
I see what you are saying.
The thing is I just need a simple onClick and I don't want to recreate this state just to overload my method.
Hey! Can confirm that the onClick is overwritten. Can classify as bug.
Out of curiosity, what are you planning to do in the onClick handler?
Hey! Can confirm that the
onClickis overwritten. Can classify as bug.Out of curiosity, what are you planning to do in the onClick handler?
I want to trigger a check to filter out options from the dropdown.
I want to trigger a check to filter out options from the dropdown.
That's interesting, can you share more? (Note: This repository is open source. If the context is unreleased/sensitive, please share it on slack #primer instead)
👋 @DavidMeu, this came up in the prioritisation call today. Can I get some context around what you are working on, that will help us if we need to prioritise a fix or recommend the workaround Patrick mentioned.
👋 @DavidMeu, this came up in the prioritisation call today. Can I get some context around what you are working on, that will help us if we need to prioritise a fix or recommend the workaround Patrick mentioned.
This is part of devportal pipeline runs. Recently Heaven UI got deprecated and devportal will replace it by the end of the quarter. Here is the official release post.
- WIP: https://github.com/primer/react/pull/4648
Hi @DavidMeu, sorry this fell through the cracks!
Would this still be useful for you?
@DavidMeu, this is now completed, should be part of the next release: https://github.com/primer/react/pull/4942