Skip to content

Conversation

cathybaptista
Copy link
Contributor

@cathybaptista cathybaptista commented Aug 13, 2024

Summary

Removed the arria instructions from combobox component. The combobox arria instructions are overly verbose and user testing reveals they are unnecessary. #5955

Breaking change

This is not a breaking change.

Related issue

Closes #5955

Related pull requests

Changelog uswds/uswds-site#2786

Preview link

Preview link:
Combobox with no arria instructions

Problem statement

  1. The arria instructions for the combo box component are verbose, however, adding them to the page would lengthen it significantly. The desired state is to not have the arria instructions on the page at all given that users already understand how to interact with this component.
  2. The actual state is that the verbose instructions are included in the arria instructions.
  3. If we dont change this the verbose arria instructions remain.

Solution

Solution:

  1. Remove lines L264-267. Instructions are too general to be helpful.
  2. Remove references to assistiveHintID variable, which was removed in 1 above.
    Why this approach was chosen: We considered adding instructions visible on the page that reflect the audible ARIA instructions. However, that would lengthen the page unnecessarily. We'd follow this guidance https://www.w3.org/WAI/WCAG21/Understanding/labels-or-instructions that suggests instructions be equally visible and audible (ie accessible to all users). In order to pass this SC, we recommend removing those additional keyboard instructions so the visible and audible instructions are more analogous.

Major changes

Removed lines L264-267 in packages/usa-combo-box/src/index.js:

    <span id="${assistiveHintID}" class="usa-sr-only">
        When autocomplete results are available use up and down arrows to review and enter to select.
        Touch device users, explore by touch or with swipe gestures.
      </span>

Removed line 228
input.setAttribute("aria-describedby", assistiveHintID);
Removed line 175
const assistiveHintID =${selectId}--assistiveHint;

Testing and review

  1. Opened federalist link and inspected source.
  2. Searched for text "When autocomplete results are available", this text was not found.
  3. Searched for text "assistiveHint", this text was not found.
  4. Opened link in production and inspected source.
  5. Searched for text "When autocomplete results are available", this text was found.
  6. Searched for text "assistiveHint", this text was found.
  • Confirm that this code follows the 18F Front End Coding Style Guide and Accessibility Guide.
  • Run git pull origin [base branch] to pull in the most recent updates from your base and check for merge conflicts. (Often, the base branch is develop).
  • Run npm run prettier:sass to format any Sass updates.
  • Run npm test and confirm that all tests pass.
  • Run your code through HTML_CodeSniffer and make sure it’s error free.

@cathybaptista cathybaptista marked this pull request as ready for review August 13, 2024 21:52
Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

Thanks @cathybaptista, LGTM. Minor comment on whether or not it's a breaking change, but not a blocker.

Please don't forget to create a changelog entry on the website (if there isn't one already).

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.

Looks good to me!

  • SR-only assistive hint is no longer appended to DOM
  • Screen reader callouts are appropriate and not overly verbose
  • No additional references to the removed assistiveHintID found in code
  • Components that extend combobox (such as time picker) also appropriately updated

I agree with @mejiaj that this doesn't qualify as a breaking change since the component markup is unaffected.

@mejiaj
Copy link
Contributor

mejiaj commented Aug 19, 2024

Moved to FFR since it's small LOE and two peer reviews is enough for this level.

Copy link
Contributor

@thisisdano thisisdano left a comment

Choose a reason for hiding this comment

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

LGTM

@thisisdano thisisdano requested a review from amycole501 October 3, 2024 03:55
@thisisdano
Copy link
Contributor

I approved, but I'd like @amycole501 to give it one last look.

Copy link

@amycole501 amycole501 left a comment

Choose a reason for hiding this comment

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

The revised combo box sounds much less wordy in both JAWS and NVDA. Much easier to listen to.

@thisisdano thisisdano merged commit d37ef9f into develop Oct 4, 2024
5 checks passed
@thisisdano thisisdano deleted the cb-remove-aria-instructions branch October 4, 2024 16:34
@thisisdano thisisdano mentioned this pull request Oct 4, 2024
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 - Feature: Remove added aria instructions to make screen reader callouts less verbose
5 participants