Skip to content

Commit b47f464

Browse files
marijohannessenhellobrian
authored andcommitted
fix(data-table): fixed accessibility issues with checkboxes (#265)
1 parent 459d68c commit b47f464

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/components/data-table/data-table.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<tr class="bx--table-row">
55
<th class="bx--table-header"></th>
66
<th class="bx--table-header bx--table-select">
7-
<input data-event="select-all" id="bx--checkbox-1" class="bx--checkbox" type="checkbox" value="green" name="checkbox">
8-
<label for="bx--checkbox-1" class="bx--checkbox-label">
7+
<input data-event="select-all" id="bx--checkbox-1" class="bx--checkbox" type="checkbox" value="green" name="checkbox-1">
8+
<label for="bx--checkbox-1" class="bx--checkbox-label" aria-label="Label name">
99
<span class="bx--checkbox-appearance">
1010
<svg class="bx--checkbox-checkmark" width="12" height="9" viewBox="0 0 12 9" fill-rule="evenodd">
1111
<path d="M4.1 6.1L1.4 3.4 0 4.9 4.1 9l7.6-7.6L10.3 0z"></path>
@@ -42,8 +42,8 @@
4242
</svg>
4343
</td>
4444
<td class="bx--table-select">
45-
<input id="bx--checkbox-2" class="bx--checkbox" type="checkbox" value="green" name="checkbox">
46-
<label for="bx--checkbox-2" class="bx--checkbox-label">
45+
<input id="bx--checkbox-2" class="bx--checkbox" type="checkbox" value="green" name="checkbox-2">
46+
<label for="bx--checkbox-2" class="bx--checkbox-label" aria-label="Label name">
4747
<span class="bx--checkbox-appearance">
4848
<svg class="bx--checkbox-checkmark" width="12" height="9" viewBox="0 0 12 9" fill-rule="evenodd">
4949
<path d="M4.1 6.1L1.4 3.4 0 4.9 4.1 9l7.6-7.6L10.3 0z"></path>
@@ -98,8 +98,8 @@ <h4><strong>Harry Potter</strong></h4>
9898
</svg>
9999
</td>
100100
<td class="bx--table-select">
101-
<input id="bx--checkbox-3" class="bx--checkbox" type="checkbox" value="green" name="checkbox">
102-
<label for="bx--checkbox-3" class="bx--checkbox-label">
101+
<input id="bx--checkbox-3" class="bx--checkbox" type="checkbox" value="green" name="checkbox-3">
102+
<label for="bx--checkbox-3" class="bx--checkbox-label" aria-label="Label name">
103103
<span class="bx--checkbox-appearance">
104104
<svg class="bx--checkbox-checkmark" width="12" height="9" viewBox="0 0 12 9" fill-rule="evenodd">
105105
<path d="M4.1 6.1L1.4 3.4 0 4.9 4.1 9l7.6-7.6L10.3 0z"></path>
@@ -175,8 +175,8 @@ <h4><strong>Harry Potter</strong></h4>
175175
</svg>
176176
</td>
177177
<td class="bx--table-select">
178-
<input id="bx--checkbox-4" class="bx--checkbox" type="checkbox" value="green" name="checkbox">
179-
<label for="bx--checkbox-4" class="bx--checkbox-label">
178+
<input id="bx--checkbox-4" class="bx--checkbox" type="checkbox" value="green" name="checkbox-4">
179+
<label for="bx--checkbox-4" class="bx--checkbox-label" aria-label="Label name">
180180
<span class="bx--checkbox-appearance">
181181
<svg class="bx--checkbox-checkmark" width="12" height="9" viewBox="0 0 12 9" fill-rule="evenodd">
182182
<path d="M4.1 6.1L1.4 3.4 0 4.9 4.1 9l7.6-7.6L10.3 0z"></path>
@@ -226,8 +226,8 @@ <h4><strong>Harry Potter</strong></h4>
226226
</svg>
227227
</td>
228228
<td class="bx--table-select">
229-
<input id="bx--checkbox-5" class="bx--checkbox" type="checkbox" value="green" name="checkbox">
230-
<label for="bx--checkbox-5" class="bx--checkbox-label">
229+
<input id="bx--checkbox-5" class="bx--checkbox" type="checkbox" value="green" name="checkbox-5">
230+
<label for="bx--checkbox-5" class="bx--checkbox-label" aria-label="Label name">
231231
<span class="bx--checkbox-appearance">
232232
<svg class="bx--checkbox-checkmark" width="12" height="9" viewBox="0 0 12 9" fill-rule="evenodd">
233233
<path d="M4.1 6.1L1.4 3.4 0 4.9 4.1 9l7.6-7.6L10.3 0z"></path>
@@ -277,8 +277,8 @@ <h4><strong>Harry Potter</strong></h4>
277277
</svg>
278278
</td>
279279
<td class="bx--table-select">
280-
<input id="bx--checkbox-6" class="bx--checkbox" type="checkbox" value="green" name="checkbox">
281-
<label for="bx--checkbox-6" class="bx--checkbox-label">
280+
<input id="bx--checkbox-6" class="bx--checkbox" type="checkbox" value="green" name="checkbox-6">
281+
<label for="bx--checkbox-6" class="bx--checkbox-label" aria-label="Label name">
282282
<span class="bx--checkbox-appearance">
283283
<svg class="bx--checkbox-checkmark" width="12" height="9" viewBox="0 0 12 9" fill-rule="evenodd">
284284
<path d="M4.1 6.1L1.4 3.4 0 4.9 4.1 9l7.6-7.6L10.3 0z"></path>
@@ -328,8 +328,8 @@ <h4><strong>Harry Potter</strong></h4>
328328
</svg>
329329
</td>
330330
<td class="bx--table-select">
331-
<input id="bx--checkbox-7" class="bx--checkbox" type="checkbox" value="green" name="checkbox">
332-
<label for="bx--checkbox-7" class="bx--checkbox-label">
331+
<input id="bx--checkbox-7" class="bx--checkbox" type="checkbox" value="green" name="checkbox-7">
332+
<label for="bx--checkbox-7" class="bx--checkbox-label" aria-label="Label name">
333333
<span class="bx--checkbox-appearance">
334334
<svg class="bx--checkbox-checkmark" width="12" height="9" viewBox="0 0 12 9" fill-rule="evenodd">
335335
<path d="M4.1 6.1L1.4 3.4 0 4.9 4.1 9l7.6-7.6L10.3 0z"></path>
@@ -379,8 +379,8 @@ <h4><strong>Harry Potter</strong></h4>
379379
</svg>
380380
</td>
381381
<td class="bx--table-select">
382-
<input id="bx--checkbox-8" class="bx--checkbox" type="checkbox" value="green" name="checkbox">
383-
<label for="bx--checkbox-8" class="bx--checkbox-label">
382+
<input id="bx--checkbox-8" class="bx--checkbox" type="checkbox" value="green" name="checkbox-8">
383+
<label for="bx--checkbox-8" class="bx--checkbox-label" aria-label="Label name">
384384
<span class="bx--checkbox-appearance">
385385
<svg class="bx--checkbox-checkmark" width="12" height="9" viewBox="0 0 12 9" fill-rule="evenodd">
386386
<path d="M4.1 6.1L1.4 3.4 0 4.9 4.1 9l7.6-7.6L10.3 0z"></path>
@@ -430,8 +430,8 @@ <h4><strong>Harry Potter</strong></h4>
430430
</svg>
431431
</td>
432432
<td class="bx--table-select">
433-
<input id="bx--checkbox-9" class="bx--checkbox" type="checkbox" value="green" name="checkbox">
434-
<label for="bx--checkbox-9" class="bx--checkbox-label">
433+
<input id="bx--checkbox-9" class="bx--checkbox" type="checkbox" value="green" name="checkbox-9">
434+
<label for="bx--checkbox-9" class="bx--checkbox-label" aria-label="Label name">
435435
<span class="bx--checkbox-appearance">
436436
<svg class="bx--checkbox-checkmark" width="12" height="9" viewBox="0 0 12 9" fill-rule="evenodd">
437437
<path d="M4.1 6.1L1.4 3.4 0 4.9 4.1 9l7.6-7.6L10.3 0z"></path>

0 commit comments

Comments
 (0)