Skip to content

Improve accessibility #85

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

Merged
merged 3 commits into from
Oct 18, 2018
Merged

Improve accessibility #85

merged 3 commits into from
Oct 18, 2018

Conversation

VictorCazanave
Copy link
Contributor

As mentioned in the issue, the <input/> is still accessible/focusable and natively reacts to keyboard events.
However I think each screen reader has different rules (like browsers) and this post says ChromeVox screen reader doesn't read content with 0 opacity.
Another solution could be to set opacity to 0.001. Anyway the <input/> has a position: absolute, so it's hidden by the toggle button (if the color isn't transparent of course).

I didn't notice any regression on the demo page but if you have time, you can double check 😄

@euvl
Copy link
Owner

euvl commented Sep 11, 2018

Role & aria-checked were there, so that screen readers knew that all HTML elements are one component (element) and would consider it to be one checkbox. As far as I know, it will not try to interpret what is inside an element if role & state is there

@VictorCazanave
Copy link
Contributor Author

All the examples I've found (MDN, W3C...) use role and aria-checked on a <span>/<div> without any <input> (the checkbox behaviour is done in JS) and the W3C validator says using these attributes on a <label> is an error.
So I thought that since the <input> is now accessible, we don't need to handle the aria attributes anymore.
But I don't know so much about accessibility and what you said makes sense 🤔
Do you want me to put role and aria-checked back?

@Artem-Schander
Copy link
Contributor

I have no idea why there are not many more people wanting this.
In my opinion it is an must have, so it would be nice if this request could be merged

@euvl euvl merged commit b6cd951 into euvl:master Oct 18, 2018
@VictorCazanave VictorCazanave deleted the fix-accessibility branch October 19, 2018 02:23
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.

3 participants