Commit e7e3cee
committed
Tree: Implement WAI-ARIA treegrid keyboard navigation
Update Tree accessibility to follow the WAI-ARIA treegrid pattern:
Keyboard navigation changes:
- Right arrow on cell 0: Expand collapsed row, or move to next cell
- Left arrow on cell 0: Collapse expanded row, or stop if collapsed
- Right/Left arrows: Navigate between cells and buttons within a row
- Tab/Shift-Tab: Move between focusable elements (buttons, editable cells)
in the current row, then exit tree when no more focusable elements
- Up/Down arrows: Navigate between rows, maintaining column position
- Arrow keys never exit the tree (always accepted)
Focus model:
- Cell-focused navigation (no row-level focus) for screen reader compatibility
- Orca expects cells to have focus, not rows - row focus only announces
expanded/collapsed state without cell content
Accessibility improvements:
- Use ROLE_TREE_GRID for multi-column trees
- Use ROLE_ROW for tree items (instead of ROLE_TREE_ITEM)
- Use ROLE_CELL for individual column cells
- Use ROLE_COLUMN_HEADER for column titles
- Hide column headers from accessibility tree when not visible
- Parent buttons to row element (not cell) to prevent announcement clutter
- Only set expanded/collapsed state on items with children
- Set active_descendant on tree grid for screen reader focus tracking
Reference: https://www.w3.org/WAI/ARIA/apg/patterns/treegrid/1 parent 5b4cbd2 commit e7e3cee
File tree
5 files changed
+232
-58
lines changed- doc/classes
- drivers/accesskit
- scene/gui
- servers/display
5 files changed
+232
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2774 | 2774 | | |
2775 | 2775 | | |
2776 | 2776 | | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
2777 | 2780 | | |
2778 | 2781 | | |
2779 | 2782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1640 | 1640 | | |
1641 | 1641 | | |
1642 | 1642 | | |
| 1643 | + | |
1643 | 1644 | | |
1644 | 1645 | | |
1645 | 1646 | | |
| |||
0 commit comments