-
Notifications
You must be signed in to change notification settings - Fork 589
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
fix: input accessibility #18
Conversation
@domyen please consider the advice on the |
Amazing job @jsomsanith! re: Add labels always Perhaps the way forward is adding a prop like From a cursory look around the web it looks like Airbnb "hides" labels in certain form elements as well. This is their CSS for hiding labels.
|
If this solution is ok for you, it's ok for me too. That's what we do in our component lib at Talend. |
@domyen
|
LGTM, merging. Excited to ship such a substantial improvement! We're on track to cut another release sometime tomorrow or the next day 🤞 |
🚀 PR was released in v0.0.23 🚀 |
What is the problem this PR is trying to solve?
Input component is not accessible.
What is the chosen solution to this problem?
<label>
id
that is passed to the input. UsehtmlFor
react attribute to associate the label with the input through the id.:before
pseudo-element anymore but in a<div>
. Generate an error id based on the props.id, that is passed to the error div. Usearia-describedby
on the input to associate the error with the input.:focus
management to have the same behavior as the:hover
.aria-hidden
on the iconStories still not really accessible
My advice would be to rework the design and replace all invalid stories with valid ones. So those usecases only:
Input with label
Input with label and value
Input with label and placeholder
Input with label and error
Disabled input with label
Input with icon + aria-label
Input with icon + aria-label and value
Input with icon + aria-label and placeholder
Input with icon + aria-label and error
Disabled input with icon