fix: ActionBar overflow menu not closing on select#7535
Conversation
🦋 Changeset detectedLatest commit: 328274e 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 |
|
👋 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.
Pull request overview
This PR fixes a bug where the ActionBar's overflow menu (the "More items" kebab menu) does not close when an item is selected. The fix changes from using onClick to onSelect for ActionList.Item components within the overflow menu, which ensures proper event bubbling that triggers the menu's close behavior.
Changes:
- Changed ActionList.Item event handler from
onClicktoonSelectin overflow menu items - Removed the eslint-disable comment for
primer-react/prefer-action-list-item-onselectrule - Added an onClick handler demo in the Default story to verify onClick functionality still works
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/react/src/ActionBar/ActionBar.tsx | Changed ActionList.Item to use onSelect instead of onClick for overflow menu items to fix menu closing behavior |
| packages/react/src/ActionBar/ActionBar.stories.tsx | Added onClick handler example to demonstrate the functionality still works |
| package-lock.json | Updated internal workspace version references from 38.10.0 to 38.11.0 |
…:primer/react into fix/action-bar-overflow-menu-not-closing
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/13480 |
Closes https://github.com/github/primer/issues/6382
Storybook improvements:
Task Listicon button inActionBar.stories.tsxto include anonClickhandler that triggers an alert, making the story interactive and easier to test.Changelog
Changed
onSelectfor ActionBar's ActionMenu items instead ofonClickso that the correct events bubble up and hide the menu upon selection.Removed
useOnClickOutsideanduseOnEscapePressRollout strategy
Testing & Reviewing
Merge checklist