content icon indicating copy to clipboard operation
content copied to clipboard

Fix aria-label documentation, removing statement that says it should be used only for interactive items

Open phsantiago opened this issue 6 months ago • 3 comments

Description

This change closes https://github.com/mdn/content/issues/28397, by changing the first paragraph of aria-label page, based on aria-label spec https://w3c.github.io/aria/#aria-label.

Motivation

There are noninteractive elements, such as List, Img, and Meter, that allow aria-label, and it's useful to have this context announced when using assistive technologies.

  • https://w3c.github.io/aria/#list aria-label is present in "Inherited States and Properties"
  • https://w3c.github.io/aria/#img aria-label is present in "Inherited States and Properties"
  • https://w3c.github.io/aria/#meter aria-label is present in "Inherited States and Properties"

Additional details

The confusion might have appeared because there are multiple non interactive aria roles, which aria-label is forbidden:

Used in Roles: All elements of the base markup except for the following roles: caption, code, definition, deletion, emphasis, generic, insertion, mark, none, paragraph, strong, subscript, suggestion, superscript, term, time

Related issues and pull requests

https://github.com/mdn/content/issues/28397

phsantiago avatar Aug 14 '24 12:08 phsantiago