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 tables, grids, treegrids #2359

Open
MelSumner opened this issue Oct 18, 2024 · 7 comments
Open

Clarify tables, grids, treegrids #2359

MelSumner opened this issue Oct 18, 2024 · 7 comments
Assignees
Labels

Comments

@MelSumner
Copy link
Contributor

MelSumner commented Oct 18, 2024

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.

Table

ARIA 1.2 definition of the table role:

“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.”

Grid

ARIA 1.2 definition of the grid role:

“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.”

TreeGrid

ARIA 1.2 definition of the treegrid role:

“A grid whose rows can be expanded and collapsed in the same manner as for a tree.”


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
Copy link
Member

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 ...

@MelSumner
Copy link
Contributor Author

MelSumner commented Oct 21, 2024

@scottaohara for me, sorting should be fine on a table. If I saw a table and it didn't let me sort, I would likely be rather annoyed. But I wouldn't expect that to be a grid.

If folks want to resize or rearrange columns, I would say that would be a grid activity.

But also, I read some of @smhigley blog posts on this topic and she delineates them by usage, not necessarily features, which I find very interesting.

Now, it is entirely possible that these definitions are correct; perhaps they only need some examples to be added to really nail down what this means. But they feel like they need both an update to the definitions, and examples for additional clarity.

@scottaohara
Copy link
Member

@MelSumner agreed on the first point.

disagree that resize/rearrange means it needs to be a grid though. especially since those are actions that don't even require a table needs to be directly editable / keyboard focusable to do those (and often to make them fully accessible, additional non-grid related UI is often necessary).

@MelSumner
Copy link
Contributor Author

disagree that resize/rearrange means it needs to be a grid though

Maybe not resize, but definitely rearrange.

Anyway, we can try to gather some more feedback before Thursday and hopefully get this on the agenda.

@MelSumner
Copy link
Contributor Author

@spectranaut I have a work conflict and can't make today's meeting, can we agenda this issue for next week please?

@MelSumner
Copy link
Contributor Author

There's also the practical nature of what works with AT and what doesn't, yes? Since @aardrian's talk comes up a lot when I talk to devs about "tables" and what can be done with them, probably should consider that as well. https://www.youtube.com/watch?v=xaIjHF7FHv8&ab_channel=WebAIM-WebAccessibilityinMind is something that was brought up in conversation with me today.

@MelSumner
Copy link
Contributor Author

MelSumner commented Nov 7, 2024

Some points of clarity:

  • keyboard around inside = grid
  • sorting and resizing columns = okay on a table
  • form elements inside of cells = okay on a table

"maintains a selection state" is more referring to something like how you can click on a row number in an excel/sheets spreadsheet and it will highlight/select the whole row.

We also discussed some potential notes around UX that aren't spec related but still okay for anyone reading the spec to consider.

Also I have volunteered to submit a PR to update the spec.

@MelSumner MelSumner self-assigned this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants