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

USWDS-Site - Fix JAWS accordion button readout #2557

Merged
merged 13 commits into from
Mar 29, 2024

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Mar 25, 2024

Summary

  • Updated accordion button markup structure to match USWDS. This PR moved any header elements inside a usa-accordion__button out of the element and instead wrapped the buttons with the headers. This aligns the code structure with the accordion code in USWDS and fixed an issue with the readout of the accordion button in JAWS.
  • Created site-accordion-heading class. This allows us to reliably style code/preview accordion buttons.
  • Updated accordion accessibility tests pages. Changed the related "Passed with exceptions" tests to "Passed"

Important

We should update the changelog date before merge

Related issue

Closes #2368

Preview link

Problem statement

The audible announcement of the "expanded" and "collapsed" state of the accordions on the component pages says "to activate press enter". It Should say "Expanded" or "collapsed".

Here is a screen recording of the accordion in use on a component pages vs. the accordion example.

This issue is only evident in JAWS. It announces correctly in NVDA.

Solution

Updating the structure surrounding usa-accordion__button to match the structure in USWDS fixes the JAWS readout.

Changes made

  • Wrapped usa-accordion__button with the header element, rather than placing the header inside the button
  • Added usa-accordion__heading class for consistency with USWDS
  • Added site-accordion-heading to reliably add styles for the site's preview and code accordions WITHOUT affecting the component preview for accordion

Before/after

- <button class="usa-accordion__button" aria-controls="accordion-code" aria-expanded="false">
-   <h3 id="pattern-code">Pattern code</h3>
- </button>
+ <h3 id="pattern-code" class="usa-accordion__heading site-accordion-heading">
+    <button class="usa-accordion__button" aria-controls="accordion-code" aria-expanded="false">
+     Pattern code
+    </button>
+ </h3> 

Testing and review

Accessibility checks

  1. Confirm that JAWS, NVDA, and VoiceOver read out either "Expanded" or "Collapsed" for the accordion buttons, depending on state

Dev checks

  1. Confirm that there are no visual or functional regressions on any "Component preview", "Component code", or "Pattern preview" accordion buttons
  2. Confirm that the header and usa-accordion__button HTML structure matches the default USWDS component code
  3. Confirm that accordion button code contains type="button
  4. Confirm that there are no instances of header elements inside usa-accordion__button elements on the site
  5. On the accordion component page, confirm that the accordion buttons inside the component preview are gray and not blue.
  6. Confirm the copy in the changelog entry is accurate and free from error.
  7. Confirm the accordion accessibility tests page renders as expected

- This aligns site code with default component code
- This fixes a readout issue in JAWS
@amyleadem amyleadem changed the title USWDS-Site [Test] - Fix JAWS accordion button readout USWDS-Site - Fix JAWS accordion button readout Mar 25, 2024
Copy link
Contributor Author

@amyleadem amyleadem Mar 26, 2024

Choose a reason for hiding this comment

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

Note

The fix in this PR should remove the "Exception" from the status for these test items. Because of that, we can also remove the status_details and github issue details.

Copy link
Contributor Author

@amyleadem amyleadem Mar 26, 2024

Choose a reason for hiding this comment

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

Note

Updating the markup structure caused the original CSS to break. Created the site-accordion-heading as a more reliable method for styling these buttons.

@amyleadem amyleadem marked this pull request as ready for review March 26, 2024 18:44
Copy link

@alex-hull alex-hull left a comment

Choose a reason for hiding this comment

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

3/25: confirmed with Amy L and Amy C that accordion in preview link read out "expanded" and "collapsed" when using the spacebar and enter key.

Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

Looking great! Just a few places that are missing the accordion heading classes and then we should be good to go 👍

  • Confirm that VoiceOver read out either "Expanded" or "Collapsed" for the accordion buttons, depending on state
  • Confirm that there are no visual or functional regressions on any "Component preview", "Component code", or "Pattern preview" accordion buttons
  • Confirm that the header and usa-accordion__button HTML structure matches the default USWDS component code
  • On the [accordion component page](https://federalist-ead78f8d-8948-417c-a957-c21ec5617a57.sites.pages.cloud.gov/preview/uswds/uswds-site/al-jaws-component-accordion/components/accordion/), confirm that the accordion buttons inside the component preview are gray and not blue.
  • Confirm that there are no instances of header elements inside usa-accordion__button elements on the site
  • Confirm the copy in the changelog entry is accurate and free from error.
  • Code changes are meaningful and free from error.
  • No perceived visual regressions throughout component pages.
    • Address page missing accordion heading classes
    • Gender identity and sex page missing accordion heading classes

pages/patterns/create-a-profile/address.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/address.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/address.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/address.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/gender-identity-and-sex.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/gender-identity-and-sex.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/gender-identity-and-sex.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/gender-identity-and-sex.md Outdated Show resolved Hide resolved
amyleadem and others added 2 commits March 27, 2024 12:54
Co-authored-by: mahoneycm <charlie.mahoney@bixal.com>
Co-authored-by: mahoneycm <charlie.mahoney@bixal.com>
@amyleadem
Copy link
Contributor Author

Thanks for catching those missing header classes, @mahoneycm. This is ready for your re-review.

pages/patterns/complex-form/establish-trust.md Outdated Show resolved Hide resolved
pages/patterns/complex-form/establish-trust.md Outdated Show resolved Hide resolved
pages/patterns/complex-form/keep-a-record.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/address.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/address.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/gender-identity-and-sex.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/gender-identity-and-sex.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/phone-number.md Outdated Show resolved Hide resolved
pages/patterns/create-a-profile/phone-number.md Outdated Show resolved Hide resolved
amyleadem and others added 2 commits March 28, 2024 13:59
@amyleadem amyleadem requested a review from mejiaj March 28, 2024 21:19
@amyleadem
Copy link
Contributor Author

amyleadem commented Mar 28, 2024

@mejiaj Thanks for flagging that this was missing the button type. The usa-accordion__button buttons should now all include type="button". This is ready for your re-review.

Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

Lgtm! Previous comment resolved

  • No perceived visual regressions throughout component pages.

- Fix formatting inconsistencies
- Consistent links
- Conssitent use of strong elements
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@annepetersen
Copy link
Contributor

annepetersen commented Mar 29, 2024

Shouldn't these all have an updated "Latest updates," then? @mejiaj

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -2,6 +2,12 @@ title: Accordion accessibility tests
type: component
changelogURL:
items:
- date: NNNN-NN-NN
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- date: NNNN-NN-NN
- date: 2024-03-29

@mejiaj
Copy link
Contributor

mejiaj commented Mar 29, 2024

@annepetersen the changes from html → markdown don't affect the output or display, so I'm inclined to leave them out of changelog.

We could note the change to the accordions though 🤔 — what do you think @amyleadem?

@annepetersen
Copy link
Contributor

@mejiaj Ah, fair enough! I had this stuck in my memory as one where we had listed Known issues publicly (without looking). Nevermind then

@annepetersen annepetersen merged commit e30f9bc into main Mar 29, 2024
11 checks passed
@annepetersen annepetersen deleted the al-jaws-component-accordion branch March 29, 2024 20:53
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.

USWDS-Site - Bug: Accordion state not reading accurately in JAWS
5 participants