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

feat(a11y): added ariaInvalid and ariaDescribedby props to SDP #1896

Open
wants to merge 3 commits into
base: master
from

Conversation

@jrparish
Copy link
Contributor

jrparish commented Jan 13, 2020

  • ariaInvalid allows for more accessible form validation
  • ariaDescribedby allows users to use custom elements for the field description instead of the built in screenReaderMessage behavior.
@jrparish jrparish force-pushed the jrparish:feature/aria-attrs branch 2 times, most recently from 85e8f4d to 55485d0 Jan 13, 2020
Copy link
Collaborator

ljharb left a comment

Can you elaborate on "allows for more accessible form validation"?

src/components/DateInput.jsx Show resolved Hide resolved
src/components/SingleDatePicker.jsx Show resolved Hide resolved
src/components/SingleDatePickerInput.jsx Show resolved Hide resolved
@ljharb ljharb requested a review from backwardok Jan 13, 2020
@jrparish

This comment has been minimized.

Copy link
Contributor Author

jrparish commented Jan 13, 2020

Can you elaborate on "allows for more accessible form validation"?

This attribute can be set to let a screen reader know a field is not valid.
For instance, a form may require a proper date. Say a user types in a partial date, which is invalid for the form, we would set aria-invalid to true to indicate to the user that the field is not correct.

src/components/DateInput.jsx Outdated Show resolved Hide resolved
src/components/DateInput.jsx Outdated Show resolved Hide resolved
src/components/DateInput.jsx Show resolved Hide resolved
src/components/SingleDatePickerInputController.jsx Outdated Show resolved Hide resolved
@jrparish jrparish force-pushed the jrparish:feature/aria-attrs branch from a184ed0 to b8e663b Jan 13, 2020
Copy link
Member

backwardok left a comment

Changes look good to me from the a11y side!

I'll let someone who's more familiar with the codebase at large to give the approval.

@ljharb ljharb requested a review from nkinser Jan 14, 2020
nkinser and others added 2 commits Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.