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

Action Menu correctly fires onAction callback after close #1228

Merged
merged 6 commits into from
May 17, 2021

Conversation

VanAnderson
Copy link
Contributor

A couple of small fixes here that seem to be possibly from a botched rebase!

The after close behavior wasn't working quite as it should have been, because the useEffect hook had the wrong dependency (open vs combinedOpenState for the work to make ActionMenu optionally controlled) - further, the onAction callback was firing twice in the code when the component was operating as a controlled component due to both the pendingActionRef being populated and the call on L82.

@changeset-bot
Copy link

changeset-bot bot commented May 14, 2021

🦋 Changeset detected

Latest commit: bdedc4e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented May 14, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/primer-components/CgEuBA2jHhzNgEuNeTNUbvxmpe78
✅ Preview: https://primer-compone-git-vananderson-action-menu-on-action-fix-8a9cc4.vercel.app

@VanAnderson VanAnderson requested a review from dgreif May 14, 2021 20:55
@vercel vercel bot temporarily deployed to Preview May 14, 2021 21:06 Inactive
Copy link
Member

@dgreif dgreif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@vercel vercel bot temporarily deployed to Preview May 14, 2021 21:33 Inactive
"@primer/components": patch
---

Action Menu correctly fires onAction callback after close.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to update these release notes to reflect the fact that it will be called before close now

@vercel vercel bot temporarily deployed to Preview May 17, 2021 19:08 Inactive
@VanAnderson VanAnderson enabled auto-merge (squash) May 17, 2021 19:08
@VanAnderson VanAnderson merged commit e1bde42 into main May 17, 2021
@VanAnderson VanAnderson deleted the VanAnderson/action-menu-on-action-fix branch May 17, 2021 19:12
@github-actions github-actions bot mentioned this pull request May 17, 2021
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

Successfully merging this pull request may close these issues.

2 participants