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

Make tooltips accessible using WAI-ARIA. #8469

Closed
wants to merge 1 commit into from

Conversation

realityking
Copy link
Contributor

To do so we have to make to modifications:
-Setting role="tooltip" on the element that is the tooltip
-Setting aria-describedby on the element that the tooltip is about

The latter requires the ID of the tooltip. I've written a small function - inspired by MooTools - to add a unique ID to any element if it doesn't have one. I chose a different name than the one jQuery UI has so there's no conflict.

The setUniqueId methods lacks documentation and unit tests. I'll happily write the former if this gets a thumb up, about the latter I have to do some reading up first.

I chose to replace the tooltip class in the LESS with the role attribute since they express the same thing and they seemed like duplicate information.

@cvrebert
Copy link
Collaborator

It seems that this breaks the existing tooltip unit tests (see Travis build results).

@realityking
Copy link
Contributor Author

Apparently I had to add the new file to js/tests/index.html, I still get some errors locally but let's see what Travis has to say.

@realityking
Copy link
Contributor Author

Ok I got this far, apparently there's still an error but I don't see any indication how to find. Could someone talk me trough that?

@fat
Copy link
Member

fat commented Jul 27, 2013

this is interesting although not quite the implementation we're looking for at the moment (dont want to switch the css to css attr's for example). thanks though!

@fat fat closed this Jul 27, 2013
cvrebert pushed a commit that referenced this pull request Aug 7, 2013
This PR significantly improves Bootstrap's accessibility for users of assistive technology, such as screen readers. Some of the these changes add additional markup to the source examples, but we believe that the sacrifice in readability is worth achieving more widespread usage of accessibility best-practices.

What was done
- Added lots of [WAI-ARIA attributes](http://www.w3.org/WAI/intro/aria)
- Added `.sr-only` helper class, that is only readable by screen readers (and invisible for all other users). This lets us - make progress bars and paginations accessible to screen reading users.
- Advised users to always use label elements. For inline forms, they can hide them with `.sr-only`
- Added 'Skip navigation' link
- Added "Accessibility" section to getting-started.html.

What *wasn't* done
- Contrast issues (#3572)
- Tooltips (#8469)
- Documentation re: usage of icons, since they now live in a separate repo

Major props to all that contributed: @bensheldon, @jasonlally, @criscristina, and @louh. Feel free to chime in, guys, if I've left anything out.
stempler pushed a commit to stempler/bootstrap that referenced this pull request Apr 11, 2014
This PR significantly improves Bootstrap's accessibility for users of assistive technology, such as screen readers. Some of the these changes add additional markup to the source examples, but we believe that the sacrifice in readability is worth achieving more widespread usage of accessibility best-practices.

What was done
- Added lots of [WAI-ARIA attributes](http://www.w3.org/WAI/intro/aria)
- Added `.sr-only` helper class, that is only readable by screen readers (and invisible for all other users). This lets us - make progress bars and paginations accessible to screen reading users.
- Advised users to always use label elements. For inline forms, they can hide them with `.sr-only`
- Added 'Skip navigation' link
- Added "Accessibility" section to getting-started.html.

What *wasn't* done
- Contrast issues (twbs#3572)
- Tooltips (twbs#8469)
- Documentation re: usage of icons, since they now live in a separate repo

Major props to all that contributed: @bensheldon, @jasonlally, @criscristina, and @louh. Feel free to chime in, guys, if I've left anything out.
stempler pushed a commit to stempler/bootstrap that referenced this pull request Nov 4, 2014
This PR significantly improves Bootstrap's accessibility for users of assistive technology, such as screen readers. Some of the these changes add additional markup to the source examples, but we believe that the sacrifice in readability is worth achieving more widespread usage of accessibility best-practices.

What was done
- Added lots of [WAI-ARIA attributes](http://www.w3.org/WAI/intro/aria)
- Added `.sr-only` helper class, that is only readable by screen readers (and invisible for all other users). This lets us - make progress bars and paginations accessible to screen reading users.
- Advised users to always use label elements. For inline forms, they can hide them with `.sr-only`
- Added 'Skip navigation' link
- Added "Accessibility" section to getting-started.html.

What *wasn't* done
- Contrast issues (twbs#3572)
- Tooltips (twbs#8469)
- Documentation re: usage of icons, since they now live in a separate repo

Major props to all that contributed: @bensheldon, @jasonlally, @criscristina, and @louh. Feel free to chime in, guys, if I've left anything out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants