Skip to content
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

Clarify/consider updates to tr element naming #403

Open
scottaohara opened this issue May 7, 2022 · 2 comments
Open

Clarify/consider updates to tr element naming #403

scottaohara opened this issue May 7, 2022 · 2 comments
Labels
accName & Desc Related to accessible name or description Clarification

Comments

@scottaohara
Copy link
Member

scottaohara commented May 7, 2022

A common issue i've been finding with interactive tables/grids where rows are focusable is that the row, if not provided an aria-label will either communicate no name, or (particularly in chromium browsers) will calculate an accName from the entirety of all the cells in that row. (this is a chromium behavior that goes beyond rows and is making for many instances of overly verbose content.)

One way I was thinking to mitigate against these unwanted outcomes was to propose that if a row is focusable, that it should look to see if it has a th element as its child, and if so, to use that element's subtree as its accessible name.

The algorithm for the th element might instead look like

if the tr is not focusable

  • aria-label or aria-labelledby
  • title attribute
  • there is no name
    (I generally question why someone is naming a table row if it is not focusable. maybe prohibit this?)

if the tr is focusable

  • aria-label or aria-labelledby
  • the subtree (or accName) of the first th element
  • the title attribute
  • the subtree of the first x cells of the row
  • there is no name (unlikely?)
@stevefaulkner
Copy link
Contributor

why not make the accname fallback be the same but first td if no th present?

@scottaohara
Copy link
Member Author

Maybe. But often in these situations there’s a checkbox in that first cell and it’s accname may not be particularly helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accName & Desc Related to accessible name or description Clarification
Projects
None yet
Development

No branches or pull requests

2 participants