Commit 9a38327
authored
fix(AnalyticalTable): improve accessibility (#7879)
Fixes #7387
Fixes #5819
On entry:
- “[Table title] grid” (Table title if set, “Grid” by screen reader
reading the role)
- `data-component-name="AnalyticalTableContainer"`: role=grid,
aria-labelledby --> `header` prop
- Total row/col count: “Table contains 123 rows and 14 columns ”
- `data-component-name="AnalyticalTableContainer"`: aria-rowcount,
aria-colcount
Column headers navigation:
- “Header” plus header cell text
- role=columnheader, text (if not text content, can be defined via
`headerLabel`)
- Header cells may contain actions like sort. This should be also
announced.
- aria-expanded, aria-controls, aria-haspopup, for column header popover
- Selection, Highlight & Navigation column header announcement
- Sort/Filter Status of row/columns must be indicated
- sort: aria-sort
- filter: aria-label="Filtered"
- group: aria-label="Grouped"
- Header Hierarchies (level 1, 2 ..) must be announced
- N.A.
Row/Cell navigation:
- Grid Cell Row/Col info = header text + position while arrowing through
grid
- Header:
- JAWS/NVDA: relation is made via roles (`columnheader` -> `gridcell`)
to prevent duplicate announcements (following wcag2.2 specs)
- VoiceOver: `aria-labelledby` pointing to column header id (workaround)
- position: `aria-colindex`
- For tables with n rows, speech output should always be <row nr of n
rows>, no matter how many rows are visible. If n is not known, speech
output should always be <row nr>
- `aria-rowindex` -> is ignored by VoiceOver - NVDA reads it, if this
becomes an issue use live announcement via invisible messaging
- Focused cells: Role and label of cell content
- `aria-labelledby`
- Interactive content: native in F5 hook, otherwise has to be defined
via `cellLabel` prop
- Selection state of cell/row must be announced
- `aria-selected` + live announcement when state changes
- Group Header Rows in Table must be announced as such
- "Grouped" is announced when focusing cell in group header row
- Freezing state of s column must be announced
- N.A.1 parent 40ee1c7 commit 9a38327
File tree
13 files changed
+508
-306
lines changed- packages/main/src
- components/AnalyticalTable
- ColumnHeader
- TableBody
- defaults/Column
- hooks
- pluginHooks
- types
- i18n
13 files changed
+508
-306
lines changedLines changed: 173 additions & 99 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
| |||
278 | 280 | | |
279 | 281 | | |
280 | 282 | | |
| 283 | + | |
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| |||
Lines changed: 50 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
20 | 36 | | |
21 | 37 | | |
22 | 38 | | |
| |||
30 | 46 | | |
31 | 47 | | |
32 | 48 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 49 | | |
37 | 50 | | |
38 | 51 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 52 | | |
44 | 53 | | |
45 | | - | |
| 54 | + | |
46 | 55 | | |
47 | 56 | | |
48 | | - | |
| 57 | + | |
49 | 58 | | |
50 | | - | |
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
| |||
56 | 64 | | |
57 | 65 | | |
58 | 66 | | |
59 | | - | |
| 67 | + | |
60 | 68 | | |
61 | 69 | | |
62 | | - | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
67 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
| 79 | + | |
69 | 80 | | |
| 81 | + | |
70 | 82 | | |
71 | 83 | | |
72 | 84 | | |
| |||
108 | 120 | | |
109 | 121 | | |
110 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
111 | 137 | | |
112 | 138 | | |
113 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
114 | 144 | | |
115 | 145 | | |
116 | 146 | | |
| 147 | + | |
117 | 148 | | |
118 | 149 | | |
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments