-
Notifications
You must be signed in to change notification settings - Fork 616
ActionList: Add aria-describedby
back to ActionList.Item
#6146
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
ActionList: Add aria-describedby
back to ActionList.Item
#6146
Conversation
🦋 Changeset detectedLatest commit: 59a6b23 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 depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
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 restores the aria-describedby
attribute on ActionList.Item
when a description is present and the CSS modules feature flag is enabled.
- Adjusts the
aria-describedby
logic inItem.tsx
to include the description under the CSS modules flag - Adds two new tests in
Item.test.tsx
to verifyaria-describedby
is applied for both default andlistbox
roles - Updates the changeset to bump a patch release with these changes
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/react/src/ActionList/Item.tsx | Expanded the aria-describedby array to include the description ID when CSS modules flag is enabled |
packages/react/src/ActionList/Item.test.tsx | Added tests verifying aria-describedby is present on items with descriptions under the feature flag |
.changeset/hip-snakes-pay.md | Bumped @primer/react patch version and summarized the PR changes |
Comments suppressed due to low confidence (2)
packages/react/src/ActionList/Item.test.tsx:439
- Consider adding a test for the inline description variant (
<ActionList.Description variant="inline">
) under the CSS modules flag to ensurearia-describedby
is applied in that scenario as well.
it('should add `aria-describedby` to items with a description', () => {
packages/react/src/ActionList/Item.tsx:344
- The condition references
slots.description
, which isn't a defined slot (the inline description slot is namedslots.inlineDescription
). As written, descriptions under the CSS modules flag won’t be included correctly. Update this to checkslots.inlineDescription
(or consolidate the block/inline checks) so the intended descriptions are always added.
slots.blockDescription ? blockDescriptionId : enabled && slots.description ? blockDescriptionId : undefined,
Closes https://github.com/github/primer/issues/5256
Adds
aria-describedby
back toActionList.Item
when CSS modules flag is enabled.Changelog
Changed
aria-describedby
is added toActionList.Item
when a description is present and the CSS modules flag is enabledRollout strategy
Testing & Reviewing
Merge checklist