Skip to content
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

fix(Treevieew):do not add aria-describedby attribute when empty leading/trailing visual #5196

Conversation

francinelucca
Copy link
Member

@francinelucca francinelucca commented Oct 31, 2024

Closes #4457

Currently a leadingVisualId and TrailingVisualId are generated and attached to the TreeItem's aria-describedby attribute regardless of whether these nodes are supplied to the component or not. This PR refactors the aria-describedby logic in to only add aria-describedby when the nodes (for trailing and leading visuals) are actually present, and mark it as undefined otherwise.

Changelog

New

  • Adds test to cover for new behavior

Changed

  • aria-describedby is only added to TreeItem's when at least one of leading/trailing visual is present and only the present ID(s) is added.

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

Testing & Reviewing

Load deployed treeview stories and ensure TreeItem's aria-describedby only contains the Id(s) of the present leading/trailing visual in the various stories.

Merge checklist

@francinelucca francinelucca added status: review needed accessibility component: TreeView Issues related to the TreeView component staff Author is a staff member labels Oct 31, 2024
Copy link

changeset-bot bot commented Oct 31, 2024

🦋 Changeset detected

Latest commit: 03a0e08

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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
Contributor

👋 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!

@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 Oct 31, 2024
Copy link
Contributor

github-actions bot commented Oct 31, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 97.36 KB (-0.17% 🔽)
packages/react/dist/browser.umd.js 97.73 KB (+0.11% 🔺)

@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/349374

@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@francinelucca francinelucca marked this pull request as ready for review October 31, 2024 15:31
@francinelucca francinelucca requested a review from a team as a code owner October 31, 2024 15:31
Copy link
Member

@keithamus keithamus left a comment

Choose a reason for hiding this comment

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

Cool 👍

@francinelucca francinelucca added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm status: review needed labels Nov 5, 2024
@francinelucca francinelucca added this pull request to the merge queue Nov 5, 2024
Merged via the queue into main with commit 49cbff2 Nov 5, 2024
49 checks passed
@francinelucca francinelucca deleted the francinelucca/4457-treeview-remove-aria-describedby-when-leading-and-trailing-visuals-do-not-exist branch November 5, 2024 17:07
@primer primer bot mentioned this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility component: TreeView Issues related to the TreeView component integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TreeView: Remove aria-describedby when leading and trailing visuals do not exist
2 participants