Skip to content

Doc encouraging user to use title instead of aria-label #301

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

Closed
Grsmto opened this issue Feb 14, 2019 · 2 comments
Closed

Doc encouraging user to use title instead of aria-label #301

Grsmto opened this issue Feb 14, 2019 · 2 comments

Comments

@Grsmto
Copy link

Grsmto commented Feb 14, 2019

Hi,

Problem description:

The documentation gives the following statement: The title attribute is usually more accessible by screen readers than mouse/visual users. However the official W3C WAI tutorial says pretty much the exact opposite:
[The title attribute] is generally less reliable [than aria-] and not recommended because some screen readers and assistive technologies do not interpret the title attribute as a replacement for the label element, possibly because the title attribute is often used to provide non-essential information.

Suggested solution:

From what I understand of the WAI tutorial, the aria-label approach is better for accessibility (screen-readers) than the title as that one might be ignored. The doc at the moment seems like encouraging the user to use title instead of aria- which might lead to bad practices.
However I read #16 but I'm not sure to understand what has been agreed on regarding usage of aria- and selectors. As there is a built-in getByTitle but no built-in selectors for aria- attributes.

Thanks!

@alexkrolick
Copy link
Collaborator

alexkrolick commented Feb 14, 2019

That statement was meant to reflect this:

The title attribute is not visible on the screen except when hovering, but is read by assistive technology. So selecting by title is less representative of how a sighted user would find elements. Label tags and aria-label are visible on screen and read out by a assistive technology.

Feel free to open a PR in the docs to improve the phrasing (issues are also welcome over there).

@kentcdodds
Copy link
Member

Moved to testing-library/testing-library-docs#38

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

No branches or pull requests

3 participants