In general, this type of treegrid acts mostly as a tree with cells. The interactions
- are the same as a tree, until one begins navigating by cells (via tab to an interactive cell or
- right arrow on an expanded row).
Accessibility Features
-
Markup used:
-
-
roles used are treegrid, row, gridcell and columnheader.
-
aria-level: used to set the current level of an item, 1, 2, 3, etc.
aria-expanded (tristate): this attribute must be removed (not present) if the item cannot be expanded. For expandable items, the value is "true" or "false". IMPORTANT: aria-expanded is set on the row unless rows cannot receive focus, because it is an indicator to the user that something is actionable. If only the cell can get focused, then pressing Enter on the cell is the only way to indicate this, so the attribute needs to go there so that screen readers will announce it. It is not added to the cell if rows can receive focus, as this provides a confusing/redundant experience where both the row and first cell announce the expanded state. In this example, JavaScript is used to move the aria-expanded attribute down to the first cell in the ?cell=force version.
-
aria-hidden: set to "true" for child items that are currently hidden because the parent is collapsed.
-
tabindex is set in the JS, as per the usual roving tabindex methodology. Specifically, we use tabindex="0" for the current item so that it is the subitem that gets focused if user tabs out and back in, and tabindex="-1" for all items where we want click-to-focus behavior enabled.
-
-
Not used in this example:
+
Focusable Elements in Current Row
-
aria-rowindex, aria-rowcount, aria-colindex, aria-colcount are not currently used, as UA/AT can compute this for fully loaded table DOMs.
-
aria-owns: not currently used, as it would be confusing to have conceptual children (other rows) vs. layout children (cells) being on the same level.
-
aria-activedescendant: this example uses to roaming tabindex method instead.
-
aria-multiselectable and aria-selected: used on row in the case of a multiselectable treegrid where each row begins with a checkbox. Must be set to false or true so that it is clear that row is selectable. Unfortunately some screen readers will read "selected" for each row even in the single selection case.
-
aria-labelledby or aria-describedby for headers? Not currently used, awaiting discussion. Some UA + screen reader combinations seem to be determining this automatically via the table structure.
+ This example uses the roving tabindex technique to manage the tabbing into and out of the treegrid and tabindex values are managed through javascript.
+
+
+ If a gridcell contains a focusable element (e.g. a, input), the focusable element gets focus instead of the gridcell. In this example the e-mail address column contains links, so the link receives focus when the user navigates to the gridcell.
+
+
+ The e-mail address link in the current message row with focus is included in the tabbing order (e.g. tabIndex=0) of the page, all other links in the treegrid are not in the tabbing order of the page (e.g. tabIndex=-1).
+
@@ -201,9 +193,7 @@
Accessibility Features
Keyboard Support
-
Note (TBD): the behavior for Left arrow and Right arrow should be switched for right-to-left language content!!
-
-
+
Key
@@ -370,30 +360,169 @@
Role, Property, State, and Tabindex Attributes
-
RoleName
+
treegrid
-
HTML_ELEMENT
+
table
- Describe usage/purpose, e.g., indicates the focusable element that serves as the ...
+ Identifies the element as a treegrid.
-
-
AttributeName=AttributeValue
-
HTML_ELEMENT
+
aria-label=ARIA Treegrid Example
+
table
-
explanation of usage, purpose, benefit, and/or guidance relevant to this implementation.
-
If making multiple statements, use list for brevity and clarity
-
Do not make a single item list.
+
Provides an accessible name for the treegrid.
+
treegrid requires an accessible name.
-
+
+
columnheader
+
+
th
+
+
+
Identifies the element as a columnheader.
+
Column headers provide context (e.g. label) for the values of the gridcells in the treegrid.
+
+
+
+
+
row
+
+
tr
+
+
+
Identifies the element as a row in the treegrid.
+
The accessible name for the row comes from concatenating the text content of the child gridcells.
+
+
+
+
+
tabindex=-1
+
tr
+
+
+
Makes the row element focusable without including it in the tab sequence of the page.
+
All row and gridcell elements are focusable, but only one is included in the tab sequence.
+
+
+
+
+
+
tabindex=0
+
tr
+
+
+
Includes the row element in the tab sequence.
+
Only one row or gridcell in the treegrid has tabindex="0".
+
In this implementation, the first row in the treegrid is included in the tab sequence when the page loads.
+
+ When the user moves focus in the treegrid, the element included in the tab sequence changes to the element with focus as described in the section on
+ roving tabindex.
+
+
+
+
+
+
+
+
aria-expanded=false
+
tr or td
+
+
+
Applied only to rows or cells elements that are parent rows. i.e., next set of rows are response to the message in this row
+
Indicates the parent row is closed, i.e., the descendant rows are not visible.
+
The visual indication of the collapsed state is synchronized by a CSS attribute selector.
+
When the treegrid is configured to support focus on rows aria-expanded is on the tr elements, but when the treegrid is configured to support focus on cells only, aria-expanded is on the first td element contained in each row.
+
+
+
+
+
+
+
aria-expanded=true
+
tr or td
+
+
+
Applied only to rows or cells elements that are parent rows. i.e., next set of rows are response to the message in this row
+
Indicates the parent row is open, i.e., the descendant rows are visible.
+
The visual indication of the open state is synchronized by a CSS attribute selector.
+
When the treegrid is configured to support focus on rows aria-expanded is on the tr elements, but when the treegrid is configured to support focus on cells only, aria-expanded is on the first td element contained in each row.
+
+
+
+
+
+
aria-level=number
+
tr
+
+
+
Defines the level of the row in the hierarchical treegrid structure.
+
Counting is one-based.
+
Root rows have aria-level=“1”.
+
+
+
+
+
+
+
aria-setsize=number
+
tr
+
+ Defines the number of rows in the set of rows that are in the same branch and at the same level within the hierarchy.
+
+
+
+
+
+
aria-posinset=number
+
tr
+
+
+
Defines the position of the row within the set of other rows that are in the same branch and at the same level within the hierarchy.
+
Counting is one-based, not zero-based.
+
+
+
+
+
gridcell
+
+
td
+
+ Identifies the element as a gridcell.
+
+
+
+
+
tabindex=-1
+
td
+
+
+
Makes the gridcell element focusable without including it in the tab sequence of the page.
+
All row and gridcell elements are focusable, but only one is included in the tab sequence.
+
+
+
+
+
+
tabindex=0
+
td
+
+
+
Includes the gridcell element in the tab sequence.
+
Only one row or gridcell in the treegrid has tabindex="0".
+
In this implementation, the first row in the treegrid is included in the tab sequence when the page loads.
+
+ When the user moves focus in the treegrid, the element included in the tab sequence changes to the element with focus as described in the section on
+ roving tabindex.
+