mdn / content

The content behind MDN Web Docs
https://developer.mozilla.org
Other
9.15k stars 22.46k forks source link

Tooltip example fails WCAG SC 1.4.13 Content on Hover or Focus #24244

Open andypillip opened 1 year ago

andypillip commented 1 year ago

MDN URL

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tooltip_role

What specific section or headline is this issue about?

Description and example

What information was incorrect, unhelpful, or incomplete?

The SC requires the tooltip to stay open, if the mouse is moved over it (hovered).

This is not mentioned in the the description’s text, and the example does not take this into account.

What did you expect to see?

Some addition that the tooltip must stay open if hovered, and either a warning along with the example, or a solution for this.

Do you have any supporting links, references, or citations?

https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus.html#hoverable

Do you have anything more you want to share?

No response

MDN metadata

Page report details * Folder: `en-us/web/accessibility/aria/roles/tooltip_role` * MDN URL: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tooltip_role * GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/accessibility/aria/roles/tooltip_role/index.md * Last commit: https://github.com/mdn/content/commit/7d2071f78f38f8be38888a32c599aebba348941b * Document last modified: 2022-09-13T12:22:39.000Z
andypillip commented 1 year ago

Further, why is there a section about the accessible name for a tooltip via aria-label? It’s neither required, nor does it seem very useful to me. The whole point of a tooltip is to make additional contents visible, is it not?

estelle commented 1 year ago

Updated with accessible name edits, but still needs work. Per https://github.com/mdn/content/pull/25587#issuecomment-1489260640 (summarizing here so people don't have to go back and forth). The example on https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tooltip_role needs to be updated

The page reads:

It [the tooltip] should disappear automatically when the focus on the owning element is lost or the mouse is moved.

This isn't enough. It should NOT disappear if the mouse is moved from the owning element to the tooltip. In that case, the tooltip MUST stay open.

The SC reads:

Persistent The additional content remains visible until the hover or focus trigger is removed, the user dismisses it, or its information is no longer valid.

This allows for classical tooltips, so they do not fail the criterion in general. The example does not satisfy the hoverable part:

Hoverable If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing;

If the tooltip does not support this, it fails the criterion, which is what is happening in the current example.