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

[a11y] Add screen reader indicator for invalid input #1621

Merged

Conversation

azimmerly
Copy link
Contributor

What & Why

The Field component does not currently indicate a failure/invalid state to screen-readers. This PR addresses this issue by adding an output element to VerificationMessages and adding an aria-invalid state to the input field.


Screen Shot 2022-06-16 at 9 54 35 AM

Screen.Recording.2022-06-16.at.9.57.57.AM.mov

@linear
Copy link

linear bot commented Jun 16, 2022

GRE-250 Add Screen Reader Failure Indicators for Invalid Form Submissions

Notion page with videos

no-alert.mov

If a user tries to log in and the credentials are incorrect, we show an error message as text underneath the immediate input or as part of a “list” of validation errors.

A screen reader-only user would only be able to “read” this text if they keyboard navigate back through the inputs and instruct their screen reader to read all the content on the page.

An example of doing this automatically this is [@react-aria/useTextBox](<https://react-spectrum.adobe.com/react-aria/useTextField.html>) reading error messages while the form input is focused:

with-screen-reader.mov

@azimmerly azimmerly requested a review from K4orta June 16, 2022 17:43
Copy link
Contributor

@K4orta K4orta left a comment

Choose a reason for hiding this comment

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

LGTM

@azimmerly azimmerly merged commit a724a83 into master Jun 23, 2022
@azimmerly azimmerly deleted the gre-250/screen-reader-alert-for-invalid-form-submission branch June 23, 2022 17:38
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.

2 participants