Fix ActionMenu bugs - #1401
Conversation
🦋 Changeset detectedLatest commit: 8420c03 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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 |
🟢 No design token changes found |
🟢 Bundle size report
|
🟢 No visual differences foundOur visual comparison tests did not find any differences in the UI. |
There was a problem hiding this comment.
Pull request overview
This PR fixes several ActionMenu.Button inconsistencies/bugs so that default mode behaves more like split-button mode (variant/leadingVisual support and click forwarding), and so split-button mode forwards consumer attributes to the intended (“primary action”) button. It also adds Storybook coverage plus unit/visual tests and a changeset entry.
Changes:
- Forward
variantandleadingVisualto the default-modeButton, and forward/correctonClick+ menu toggle behavior. - Correct attribute forwarding in split-button mode so consumer attributes apply to the primary action (not the menu toggle).
- Add/extend unit tests, visual snapshot coverage, and Storybook feature stories for the fixed behaviors.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/ActionMenu/ActionMenu.tsx | Adds menu-toggle callback plumbing and updates ActionMenu.Button rendering/prop forwarding in default and split-button modes. |
| packages/react/src/ActionMenu/ActionMenu.test.tsx | Adds unit tests covering default-mode onClick + toggle, default-mode variant/leadingVisual, and split-button attribute/onClick separation. |
| packages/react/src/ActionMenu/ActionMenu.visual.spec.ts | Adds visual snapshots for the new default-mode variant + leadingVisual stories. |
| packages/react/src/ActionMenu/ActionMenu.features.stories.tsx | Adds new feature stories to demonstrate default-mode variant rendering and leadingVisual rendering. |
| .changeset/fix-action-menu-split-button-click.md | Documents the user-visible changes and the split-button attribute forwarding behavior change. |
Review details
- Files reviewed: 5/7 changed files
- Comments generated: 3
- Review effort level: Low
🟢 Unit test coverage changes foundUnit test coverage has been updated through this PR. Changes: 0 new tests, 0 removed tests, 1 improved, 0 decreased
|
danielguillan
left a comment
There was a problem hiding this comment.
This looks great! Thank you for the fixes. We only need to update the React documentation to include the newly supported variant in the props table and revise the split-button guidance. 🚀
Summary
Fixes multiple issues in the ActionMenu component.
Fixes #1372
Fixes #1366
Fixes #1397
List of notable changes:
What should reviewers focus on?
Steps to test:
Contributor checklist:
update snapshotslabel to the PR)Reviewer checklist:
Screenshots:
Leading visual
Alternative variants