Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

Following PR #7322, data-disabled is set on all disabled <li> elements, while aria-disabled only appears when listSemantics=true. The redundant [aria-disabled] selectors can be removed.

Changelog

Changed

  • Simplified three CSS selectors to use only [data-disabled]:
    • Line 132: Removed [aria-disabled] from :not() hover/active selector
    • Line 334: Removed &[aria-disabled='true'] duplicate selector
    • Line 376: Changed trailing action selector from [aria-disabled] to [data-disabled]

Removed

  • Redundant [aria-disabled] attribute selectors on <li> elements

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

CSS-only change with no functional impact. data-disabled already covered all cases.

Testing & Reviewing

No visual or behavioral changes. data-disabled was already present in all disabled states.

Merge checklist

Original prompt

Summary

Clean up redundant [aria-disabled] selectors in ActionList.module.css since data-disabled is now the single source of truth for disabled styling on the <li> element.

Background

In PR #7322, we added data-disabled to the <li> element to avoid expensive :has() descendant scans. However, we kept some redundant [aria-disabled] checks on the <li> that are no longer necessary:

  1. aria-disabled is only set on the <li> when listSemantics=true (via containerProps)
  2. data-disabled is always set on the <li> when disabled=true, regardless of list/button semantics
  3. Therefore, data-disabled already covers all cases where aria-disabled would match

Changes needed

In packages/react/src/ActionList/ActionList.module.css:

  1. Simplify the hover/active selector (around line 131):
/* Before */
&:not([aria-disabled], [data-disabled='true'], [data-has-subitem='true'])

/* After */
&:not([data-disabled='true'], [data-has-subitem='true'])
  1. Simplify the disabled styles selector (around line 332-333):
/* Before */
&[aria-disabled='true'],
&[data-disabled='true'] {

/* After */
&[data-disabled='true'] {

This makes data-disabled the single source of truth for disabled styling, which is cleaner and easier to maintain.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Jan 2, 2026
@changeset-bot
Copy link

changeset-bot bot commented Jan 2, 2026

⚠️ No Changeset found

Latest commit: 86bfda5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Clean up redundant [aria-disabled] selectors in ActionList module Remove redundant [aria-disabled] selectors in ActionList.module.css Jan 2, 2026
Copilot AI requested a review from mattcosta7 January 2, 2026 16:57
@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.

@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
@mattcosta7 mattcosta7 marked this pull request as ready for review January 2, 2026 21:12
@mattcosta7 mattcosta7 requested a review from a team as a code owner January 2, 2026 21:12
@mattcosta7 mattcosta7 requested a review from jonrohan January 2, 2026 21:12
@mattcosta7 mattcosta7 merged commit bffcd21 into perf/actionlist-has-selector Jan 2, 2026
48 of 49 checks passed
@mattcosta7 mattcosta7 deleted the copilot/clean-up-redundant-aria-selectors branch January 2, 2026 21:12
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants