question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Table accessibility issues

See original GitHub issue

There are a few issues with the aria roles on the current table implementation:

  • role="grid" should be an attribute on the table element instead of the inner grid
  • all table rows (including the header row) should have role="row" even if they don’t have event handlers like onRowClick

See aria documentation for more details. Elements with role="grid" require descendants with role="row", and elements with role="rowheader" require an ancestor with role="row" which requires an ancestor with role="grid".

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
thiemeljiricommented, Aug 14, 2019

Is there a way how to not add these attributes? You have it wrong and even if that was implemented correctly it’s not always what you want, which is our case.

Role grid must be sued only when it’s a data grid with implemented keyboard navigation. Using such roles without implementing the rest hurts the accessibility.

I strongly suggest removal of the role grid and I would like to know the motivation behind adding it. This is how to use it properly and believe me, that’s not what you wan’t in many cases. https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html

0reactions
jchen527commented, Mar 5, 2017

Re: your comment about Grid having no role=“row” children, I believe elements with role=“grid” do require descendants with role=“row” or role=“rowgroup” because they are “Required Owned Elements”. I’ve been using the Accessibility Developer Tools chrome extension and the audit complains when there is only an element with role=“grid”.

Thanks for the quick review and role="rowgroup" change!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Trouble with Tables: A Brief Introduction - Level Access
When we test tables to see how successfully they have been tagged for accessibility, we find these common issues: Is This a Data...
Read more >
Tables Tutorial | Web Accessibility Initiative (WAI) - W3C
Tables without structural markup to differentiate and properly link between header and data cells, create accessibility barriers. Relying on visual cues alone ...
Read more >
Table accessibility failures - AccessibilityOz
Perhaps you need a comprehensive list of likely accessibility issues with tables ... The Tables section details 25 accessibility problems and how to...
Read more >
Tables - Usability & Web Accessibility - Yale University
Tables · Layout Tables vs Data Tables · Use Headers and Scope · Use Table Captions · Avoid Complex Tables · Avoid Empty...
Read more >
Table Techniques to Avoid | Web Accessibility
Inaccessible tables are often the result of making them too complex, for example by trying to accomplish too much with one table or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found