-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Comments
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). |
Closes testing-library#306 Closes testing-library#301 Closes testing-library#235 Closes testing-library#181 Closes testing-library#172 Closes testing-library#31
…ary#308) Closes testing-library#306 Closes testing-library#301 Closes testing-library#235 Closes testing-library#181 Closes testing-library#172 Closes testing-library#31
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 thetitle
as that one might be ignored. The doc at the moment seems like encouraging the user to usetitle
instead ofaria-
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-ingetByTitle
but no built-in selectors foraria-
attributes.Thanks!
The text was updated successfully, but these errors were encountered: