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

Add aria-describedby support #7

Open
SrMouraSilva opened this issue Sep 29, 2016 · 2 comments
Open

Add aria-describedby support #7

SrMouraSilva opened this issue Sep 29, 2016 · 2 comments

Comments

@SrMouraSilva
Copy link

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute

The aria-describedby attribute is used to indicate the IDs of the elements that describe the object. It is used to establish a relationship between widgets or groups and text that described them. This is very similar to aria-labelledby: a label describes the essence of an object, while a description provides more information that the user might need.

@SrMouraSilva SrMouraSilva changed the title Add aria-describedby in examples Add aria-describedby support Sep 29, 2016
@cheshrkat
Copy link

Not sure if labelled-by will work here as the implementation uses generated content. Labelled by works for tooltips which have a separate DOM element (http://accessibility.athena-ict.com/aria/examples/tooltip.shtml) but I don't think generated content can be associated that way (I could be wrong though! :)).

This implementation would work if it was based on aria-label rather than the custom data attr; or included the same text string in aria-label as the custom data attribute. To see it in action the examples need tabindex="0" (so you can tab to them with the keyboard); and the styles will need to show for focus as well as hover (which is mouse-only). http://codepen.io/jacmaes/pen/sDiof has a similar proof of concept.

Putting it together in the HTML:
<span aria-label="This is a tooltip!" data-wenk="This is a tooltip!" tabindex="0"></span>

Then in, say, wenk.scss change &:hover on line 36 to &:focus, &:hover, &:active

To test visibly: hit tab until the system focus moves to the element with the tooltip; your tooltip should show.

@tiaanduplessis
Copy link
Owner

@cheshrkat sounds good 👍. Will take a look as soon as I have time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants