-
Notifications
You must be signed in to change notification settings - Fork 12
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
va-accordion: remove aria-controls and aria-expanded from expand all button #1400
Conversation
…d all button. * Removed two ARIA attributes from Expand all button. * Removed ARIA attributes from va-accordion e2e test.
const accordionItemIDs = [...this.el.children] | ||
.filter((el) => el.tagName.toLowerCase() === 'va-accordion-item') | ||
.map((el) => el.id); | ||
|
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.
This block was no longer needed after the aria-controls
attribute was removed. TypeScript was complaining so I opted to remove it.
Hi @1Copenut, This was initially developed the way you have it, using the button text to signal the status of the accordions, but
So I don't believe we should remove Can you let me know your thoughts? Thanks! |
Thank you for testing with JAWS @rsmithadhoc. I'm surprised that JAWS isn't announcing the changed text when you toggle back and forth, but maybe I shouldn't be. :) I still believe that removing the |
@@ -14,7 +14,7 @@ describe('va-accordion', () => { | |||
<va-accordion class="hydrated"> | |||
<mock:shadow-root> | |||
<div class="usa-accordion"> | |||
<button aria-controls="" aria-expanded="false" aria-label="expand-all-aria-label" class="va-accordion__button"> | |||
<button aria-label="expand-all-aria-label" class="va-accordion__button"> |
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.
/cc @1Copenut
TODO: Add a data-cytest="NAME"
attribute here and update the Cypress expandAccordions()
helper. Could add an optional argument to accept a string value, but definitely need to ensure the helper doesn't break or tests start failing.
I believe |
@1Copenut How do you feel about removing the |
@rsmithadhoc I went ahead and removed the I still hold to my personal desire to remove the |
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.
Looks good, thanks!
va-accordion
expand all button
Commit log
Chromatic
https://patch-tpierce-accordionExpandAll--65a6e2ed2314f7b8f98609d8.chromatic.com
Reasoning for this change
I opted to remove the
aria-expanded
attribute from the<va-accordion>
expand all button because it was announcing as "Collapse all accordions, expanded" in screen reader testing. This felt contradictory and potentially confusing. I felt the change in button text alone made it very clear that I had expanded 1 to N accordions as a group.This change triggered an axe-core error for the
aria-controls
attribute. I did some more digging and determined that JAWS is still the only screen reader adoptingaria-controls
. JAWS uses this attribute to set virtual cursor on the "controlled" content, which here would be multiple things and not especially helpful. I used the following resources to validate this decision:Configuring this pull request
major
,minor
,patch
, orignore-for-release
).ignore-for-release
if files haven't been changed in a component library package. (ie. only Storybook files)/packages/core
version number if this will be the last PR merged before a release.Description
Closes department-of-veterans-affairs/va.gov-team#96354
QA Checklist
Designer has signed off on changes (if applicable. If not applicable provide reason why)New components are covered by e2e tests; updates to existing components are covered by existing test suiteScreenshots
Acceptance criteria
Definition of done
Documentation has been updated, if applicable