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 - Validation: Add screen reader summary on init #5897

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Apr 26, 2024

Summary

Added a screen reader summary of input requirements to the validation component on initialization. Previously, the component only provided this summary when the user added content to the input.

Breaking change

This is not a breaking change.

Related issue

Closes #5841

Related pull requests

Changelog PR

Preview link

Validation component

Problem statement

If a screen reader user navigates via the tab key, they will arrive on the validation component input without being made aware of the validation requirements.

Solution

Ran the validate() function on init. Previously, the function was designed to be called only on update. This required the following changes:

  1. Removed the debounce from the validate() function. This debounce should only be added on update.
  2. Added the validate function to init
  3. Added debounce to handleChange()

Testing and review

  1. Confirm that the status summary appears in the #code-sr-summary element on component initialization
  2. Confirm that the status summary appears in the #code-sr-summary element when you update the input
  3. Confirm that code meets standards

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: Enhance screen reader callouts for Validation component
1 participant