Skip to content

Conversation

@TylerJDev
Copy link
Member

Closes https://github.com/github/primer/issues/6264

When open state is uncontrolled (i.e. open is not passed to ActionMenu by the consumer) and the menu is fullscreen, we do not check if the component is "open" via the internal state (via combinedOpenState). This ensures that both controlled and uncontrolled states are accounted for within the onClose conditional.

Changelog

New

Changed

  • Adds both controlled/uncontrolled states to onClose conditional

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Jan 2, 2026

🦋 Changeset detected

Latest commit: dc7bf44

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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

@github-actions github-actions bot added the staff Author is a staff member label Jan 2, 2026
@TylerJDev TylerJDev changed the title Ensure uncontrolled ActionMenu is handled properly when fullscreen ActionMenu: Ensure uncontrolled ActionMenu is handled properly when fullscreen Jan 2, 2026
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jan 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@TylerJDev TylerJDev marked this pull request as ready for review January 2, 2026 18:12
@TylerJDev TylerJDev requested a review from a team as a code owner January 2, 2026 18:12
Copilot AI review requested due to automatic review settings January 2, 2026 18:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where uncontrolled ActionMenu components were not properly retaining tab focus when displayed in fullscreen mode. The issue occurred because the onClose callback only checked the open prop to determine if the menu should stay open on tab gesture, but didn't account for the internal state when open was undefined (uncontrolled mode).

Key changes:

  • Adds logic to determine the correct open status by checking if open is controlled or uncontrolled
  • Updates the dependency array of the onClose callback to include combinedOpenState

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/react/src/ActionMenu/ActionMenu.tsx Adds conditional logic to use either controlled open prop or internal combinedOpenState for determining if the menu should stay open on tab gesture in fullscreen mode, and updates the callback dependency array
.changeset/fast-pots-say.md Adds changeset entry documenting the fix as a patch release

@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/9618

@primer-integration
Copy link

🔬 github-ui Integration Test Results

Check Status Details
CI ✅ Passed View run
Projects (Memex) ✅ Passed View run
VRT ✅ Passed View run

All checks passed! Your integration PR is ready for review.

Copy link
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants