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 1 year 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

Might make sense to explicitly mention aria-label can be used to name an element, so long as the elements implicit or explicit aria role doesn’t prohibit naming.

Listitem, for example being a role that is incorrectly not in the name prohibited category, but will be once the spec updates to correct this. But the other example, role=list or main, article, etc are all nameable roles/elements.

scottaohara avatar Aug 14 '24 15:08 scottaohara

Preview URLs

(comment last updated: 2024-08-27 04:32:12)

github-actions[bot] avatar Aug 19 '24 14:08 github-actions[bot]

@scottaohara I’ve addressed the feedback provided in the initial review of PR. Could you please take some time to re-review? Thanks in advance 🙂

phsantiago avatar Aug 26 '24 13:08 phsantiago

Hi @scottaohara, thanks for your previous review. I applied the change you suggested https://github.com/mdn/content/pull/35465/commits/0ead6ef8737421e4323f290ef1d82952dec270a3

Would you mind taking another look when you have a moment? I really appreciate your time and effort in helping get this PR merged

phsantiago avatar Sep 03 '24 07:09 phsantiago

Hi @scottaohara, just following up on this PR as it’s been a few weeks since my last re-review request. I’ve addressed the feedback, and would really appreciate it if you could take another look when you have time. Thanks again!

phsantiago avatar Sep 22 '24 19:09 phsantiago

Perhaps @estelle could also review this, if @scottaohara could not

Josh-Cena avatar Oct 15 '24 18:10 Josh-Cena