w3c / aria

Accessible Rich Internet Applications (WAI-ARIA)
https://w3c.github.io/aria/
Other
645 stars 125 forks source link

Clarify tables, grids, treegrids #2359

Open MelSumner opened 1 day ago

MelSumner commented 1 day ago

Describe your concern

Looking at the descriptions for tables, grids, and tree grids, and how they're defined. They're causing some confusion on a team I'm currently working with, where we are seeking to define the boundaries for these kinds of elements/components.

Specifically:

  1. Clarify "selection state" in table: "If the tabular container maintains a selection state" with perhaps a note that means "i.e., selecting a row in an excel spreadsheet. This does not refer to a check box in a table column."
  2. Clarify if permitting column sorting on tables still qualifies it as a table, or if it should be a datagrid if sorting is supported. It's incredibly common to have sortable tables, and I haven't experienced AT issues with sortable tables (maybe others have and can chime in?)
  3. Add a note about the current state of treegrid; I've been consistently advised that treegrid is not well supported and should be avoided; if that's the case, should expandable rows in a data-type grid be avoided all together?

Link to the version of the specification or documentation you were looking at at.

Link to documentation:

Table

“The table role is intended for tabular containers which are not interactive. If the tabular container maintains a selection state, provides its own two-dimensional navigation, or allows the user to rearrange or otherwise manipulate its contents or the display thereof, authors SHOULD use grid or treegrid instead.” - ARIA 1.2 definition of the table role

Grid

“A composite widget containing a collection of one or more rows with one or more cells where some or all cells in the grid are focusable by using methods of two-dimensional navigation, such as directional arrow keys.

The grid role does not imply a specific visual, e.g., tabular, presentation. It describes relationships among elements. It may be used for purposes as simple as grouping a collection of checkboxes or navigation links or as complex as creating a full-featured spreadsheet application.

The cell elements of a grid have role gridcell. Authors MAY designate a cell as a row or column header by using either the rowheader or columnheader role in lieu of the gridcell role. Authors MUST ensure elements with role gridcell, columnheader, or rowheader are owned by elements with role row, which are in turn owned by an element with role rowgroup, or grid.” - ARIA 1.2 definition of the grid role

TreeGrid

“A grid whose rows can be expanded and collapsed in the same manner as for a tree.” - ARIA 1.2 definition of the treegrid role

Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)?

I perceive that it does.

scottaohara commented 1 day ago

not going to lie, i think this is the first time that i've really given a hard look at the table definition here in the ARIA spec. Absolutely agree that there are some clarifications that could be made there. I think I better understand now why I've talked to some developers who have assumed that table sorting or resizing means it "HAS" to be a grid ...