Skip to content

Conversation

danielguillan
Copy link
Contributor

@danielguillan danielguillan commented May 20, 2025

Summary

Fixes an issue in ActionMenu where anchor links in split-button mode were only clickable on the text. Now, the clickable area covers the full width and height of the item.

Storybook

Screenshots:

Please try to provide before and after screenshots or videos

Before After

screenshot-mntadhbz-000236@2x

screenshot-TstYElYb-000234@2x

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 08:04
Copy link

changeset-bot bot commented May 20, 2025

🦋 Changeset detected

Latest commit: 27b8901

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

This PR includes changesets to release 7 packages
Name Type
@primer/react-brand Patch
@primer/brand-docs Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook 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

Copy link

@Copilot 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 expands the clickable area of split-button anchors in ActionMenu to cover the full item by switching the anchor to a grid subgrid and adjusting padding for medium-sized items.

  • Changed grid-template-columns to allow the text area to flex.
  • Converted the anchor wrapper to use CSS Grid with subgrid sizing.
  • Zeroed out parent padding and applied it directly to the anchor for medium items.
  • Added a changeset entry summarizing the fix.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/react/src/ActionMenu/ActionMenu.module.css Updated the item’s grid layout, switched the anchor to a full-size subgrid, and added medium padding.
.changeset/hungry-tips-sing.md Added a patch changeset noting the fixed clickable area in split-button mode.
Comments suppressed due to low confidence (2)

packages/react/src/ActionMenu/ActionMenu.module.css:185

  • CSS subgrid is only supported in Firefox. Consider adding a fallback layout or confirming that your supported browser list includes subgrid support to avoid broken layouts.
grid-template-columns: subgrid;

packages/react/src/ActionMenu/ActionMenu.module.css:216

  • [nitpick] The CSS :has() selector may not be supported in all target browsers and can have performance implications. Verify browser compatibility or consider an alternative approach for broader support.
.ActionMenu__item--medium:has(.ActionMenu__item-anchor) {

Copy link
Contributor

🟢 No design token changes found

Copy link
Contributor

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

@danielguillan danielguillan requested a review from joshfarrant May 20, 2025 08:18
Copy link
Contributor

@joshfarrant joshfarrant left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

@danielguillan danielguillan merged commit 1afeeae into main May 20, 2025
18 checks passed
@danielguillan danielguillan deleted the danielguillan/fix-action-menu-anchor-size branch May 20, 2025 08:50
@primer-css primer-css mentioned this pull request May 20, 2025
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