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

[ActionMenu.Button] onClick doesn't function #4647

Closed
DavidMeu opened this issue Jun 6, 2024 · 12 comments · Fixed by #4648
Closed

[ActionMenu.Button] onClick doesn't function #4647

DavidMeu opened this issue Jun 6, 2024 · 12 comments · Fixed by #4648
Assignees
Labels
bug Something isn't working react

Comments

@DavidMeu
Copy link

DavidMeu commented Jun 6, 2024

Description

When trying to pass a function to ActionMenu.Button it doesn't get invoked.

Image

Steps to reproduce

  1. Goto: https://primer.style/react/ActionMenu
  2. Overload onClick and see it doesn't get invoked on clicking.

Version

^36.19.1

Browser

No response

@DavidMeu DavidMeu added the bug Something isn't working label Jun 6, 2024
Copy link
Contributor

github-actions bot commented Jun 6, 2024

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.

@patrickhlauke
Copy link

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).

@DavidMeu
Copy link
Author

DavidMeu commented Jun 6, 2024

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).

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.

@siddharthkp
Copy link
Member

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?

@DavidMeu
Copy link
Author

DavidMeu commented Jun 6, 2024

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?

I want to trigger a check to filter out options from the dropdown.

@siddharthkp
Copy link
Member

siddharthkp commented Jun 6, 2024

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)

@siddharthkp siddharthkp self-assigned this Jun 10, 2024
@siddharthkp
Copy link
Member

👋 @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
Copy link
Author

DavidMeu commented Jun 10, 2024

👋 @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.

@siddharthkp
Copy link
Member

siddharthkp commented Jun 18, 2024

@siddharthkp
Copy link
Member

Hi @DavidMeu, sorry this fell through the cracks!

Would this still be useful for you?

@DavidMeu
Copy link
Author

DavidMeu commented Sep 1, 2024

Hi @DavidMeu, sorry this fell through the cracks!

Would this still be useful for you?

Yes 🙏🏽

@siddharthkp
Copy link
Member

@DavidMeu, this is now completed, should be part of the next release: #4942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working react
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants