-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Improve accessibility of the checkbox/radio buttons plugin #14635
Comments
It was a creative solution to a problem: functional "radio" button groups. Folks wanted easy to use form-based components, but with the style of our buttons, so we gave it to them in an easy to implement way.
I'd caution @danielnixon and others to not assume malice or willful ignorance in these matters. We're a small team building a tool for millions of people. Mistakes and "bad implementations" are bound to happen. I'm curious what we can do here. Is the solution radio buttons inside/outside the actual buttons? How do we keep sane markup without losing accessibility? |
As he says in his post and does in his accessibility plugin fork, the existing markup can be made to work by adding some ARIA attributes. |
That blog post is a little bit inaccurate/won't work as advertised. With an adjacent sibling selector, you can style the visible part of the button based on the focus state of the A good thing to note is that you change the selected Don't know how difficult it would be to integrate something like that into Bootstrap. |
The current Bootstrap radio/checkbox buttons actually do work with keyboard input, you just can't see the focus styles because the |
@alexlande, in reply to your first comment, that sounds like a WebKit bug. Or are Firefox and IE doing something wrong by honoring tabindex on labels? In reply to your second comment, that wasn't the case when I created the PR/wrote that post; a commit to button.js added it some time between then and now. |
@danielnixon: Yeah, it's a webkit + blink bug. I did some research into this a while back and I think IE is the only browser that handles |
I'm personally in favor of the |
@cvrebert: Would it be worthwhile for me to open a PR to see what that might look like? |
@alexlande Eh, we're already planning to look at it for v4 (and definitely not for v3), which is still a little ways off, so I wouldn't bother. Appreciate the enthusiasm though. |
👍 |
So what needs doing here exactly for v3.2.1? We can't use the |
|
I don't think that will work (see previous comments). Webkit + Blink don't support
In which the |
Oh, we have the |
Yeah, see #13907. |
Nice! In that case you should be in good shape. |
Closing out then. |
This means visual users will see buttons but non-visual users will get check boxes (or radio buttons), doesn't it? If so, I think that's still problematic. Consider a scenario where a vision-impaired user is working with a non-vision-impaired user on the same page (maybe they're collaborating on the same physical computer, or maybe it's a desktop sharing type scenario, or maybe it's a tech support phone call). The conversation could go something like this (or the inverse): A: "Alright, now check the foo check box". |
That's a fair concern. What do you think a good solution for it is? I'm kind of at a loss. Thierry Koblentz wrote an article + demo recently with a similar technique, and my feeling at the time was that it validated this kind of usage, a11y-wise. Seems like a slippery slope to attempt to make a page read that similarly for sighted and non-sighted users (rather than just making it work well for both groups), but maybe I'm off-base. |
personally, i think the "sighted and non-sighted user working together" scenario is a rather edge-case one. also, assuming the checkbox has a logically-named label, the conversation would be "tick the 'chicken' checkbox", "i don't see a checkbox, but there's something that looks like a toggle button labelled 'chicken', do you mean that?" |
See this blog post. I'm baffled as to why @danielnixon didn't file a bug about this.
The text was updated successfully, but these errors were encountered: