-
Notifications
You must be signed in to change notification settings - Fork 0
/
treegrid.html
121 lines (115 loc) · 4.82 KB
/
treegrid.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html>
<head>
<title>ARIA Tree Grid Example</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="./text.css">
<link rel="stylesheet" href="./treegrid.css">
<script src="./treegrid.js"></script>
</head>
<body>
<h1>General info</h1>
<p><a href="https://github.com/aleventhal/master/tree/right-on-expanded-focuses-cell">Jump to documentation and source</a>.
<h1>Keyboard UI</h1>
<table id="key-info">
<thead>
<tr>
<th>Keys</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<th>Up/down</th>
<td>Move by row as in an ordinary tree. If focused on a cell, will move
to the same cell in the newly focused row</td>
</tr>
<tr>
<th>Left/right</th>
<td>Collapse/expand as in an ordinary tree. If the row is already expanded, right arrow will focus the first cell. If focused on a non-editable cell, will navigate to an adjacent cell.</td>
</tr>
<tr>
<th>Home/end</th>
<td>Move to first/last row or cell, depending on whether user currently focused on a row or cell.</td>
</tr>
<tr>
<th>Ctrl+Home/ctrl+end</th>
<td>Move to first/last row, keeping focus on same cell if a cell was focused.</td>
</tr>
<tr>
<th>Tab/shift+tab</th>
<td>If there are focusable items in the currently active row,
will navigate between them, otherwise navigates out of the treegrid</td>
</tr>
<tr>
<th>Enter</th>
<td>Do the default action for the row/cell. For example, open a message. If on the first cell, and no other action, will toggle row expansion. </td>
</tr>
<tr>
<th>Spacebar</th>
<td>In a multiselectable treegrid, will toggle checkbox at start of row
that corresponds to selecting the current row</td>
</tr>
</tbody>
</table>
<h1>Example</h1>
<table id="treegrid" role="treegrid" aria-readonly="true" aria-label="ARIA treegrid example">
<colgroup>
<col id="treegrid-col1">
<col id="treegrid-col2">
<col id="treegrid-col3">
</colgroup>
<thead>
<tr>
<th>Subject</th>
<th>Summary</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<!-- Filed https://bugzilla.validator.nu/show_bug.cgi?id=1033 on Nu Validator
because aria-setsize, aria-posinset not allowed -->
<tr id="1" role="row" aria-level="1" aria-posinset="1" aria-setsize="1" aria-expanded="true">
<td role="gridcell">Treegrids are broken</td>
<td role="gridcell">How do we fix them?</td>
<td role="gridcell"><a href="mailto:[email protected]">[email protected]</a></td>
</tr>
<tr id="1.1" role="row" aria-level="2" aria-posinset="1" aria-setsize="3">
<td role="gridcell">re: Treegrids are broken</td>
<td role="gridcell">I agree with you, but ...</td>
<td role="gridcell"><a href="mailto:[email protected]">[email protected]</a></td>
</tr>
<tr id="1.2" role="row" aria-level="2" aria-posinset="2" aria-setsize="3" aria-expanded="true">
<td role="gridcell">re: Treegrids are broken
<td role="gridcell">Not that many people use them
<td role="gridcell"><a href="mailto:[email protected]">[email protected]</a></td>
</tr>
<tr id="1.2.1" role="row" aria-level="3" aria-posinset="1" aria-setsize="1">
<td role="gridcell">re: Treegrids are broken</td>
<td role="gridcell">We still need them, plus it's a spec hole</td>
<td role="gridcell"><a href="mailto:[email protected]">[email protected]</a></td>
</tr>
<tr id="1.3" role="row" aria-level="2" aria-posinset="3" aria-setsize="3" aria-expanded="true">
<td role="gridcell">re: Treegrids are broken</td>
<td role="gridcell">Can someone suggest something?</td>
<td role="gridcell"><a href="mailto:[email protected]">[email protected]</a></td>
</tr>
<tr id="1.3.1" role="row" aria-level="3" aria-posinset="1" aria-setsize="1" aria-expanded="false">
<td role="gridcell">re: Treegrids are broken</td>
<td role="gridcell">They are more like trees than grids, not that many columns usually</td>
<td role="gridcell"><a href="mailto:[email protected]">[email protected]</a></td>
</tr>
<tr id="1.3.1.1" role="row" aria-level="4" aria-posinset="1" aria-setsize="2" aria-hidden="true">
<td role="gridcell">re: Treegrids are broken</td>
<td role="gridcell">Cool, let's keep left/right collapse/expand like a tree</td>
<td role="gridcell"><a href="mailto:[email protected]">[email protected]</a></td>
</tr>
<tr id="1.3.1.2" role="row" aria-level="4" aria-posinset="2" aria-setsize="2" aria-hidden="true">
<td role="gridcell">re: Treegrids are broken
<td role="gridcell">There be a column navigation command</td>
<td role="gridcell"><a href="mailto:[email protected]">[email protected]</a></td>
</tr>
</tbody>
</table>
</body>
</html>