-
Notifications
You must be signed in to change notification settings - Fork 648
ActionMenu: Ensure uncontrolled ActionMenu is handled properly when fullscreen
#7408
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: dc7bf44 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
ActionMenu is handled properly when fullscreenActionMenu is handled properly when fullscreen
|
👋 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 |
There was a problem hiding this 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
openis controlled or uncontrolled - Updates the dependency array of the
onClosecallback to includecombinedOpenState
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 |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/9618 |
francinelucca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Closes https://github.com/github/primer/issues/6264
When
openstate is uncontrolled (i.e.openis not passed toActionMenuby the consumer) and the menu is fullscreen, we do not check if the component is "open" via the internal state (viacombinedOpenState). This ensures that both controlled and uncontrolled states are accounted for within theonCloseconditional.Changelog
New
Changed
onCloseconditionalRollout strategy
Testing & Reviewing
Merge checklist