-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessibility: Multi edit widget (select and checkboxes) need labels #1842
Comments
As part of #1842 - more additions planned
Looking at this, I have put a label onto the first multi-select Proposals:
Possibly also some ARIA to show the linkage between the checkbox column and the multi-edit widget. I'd need help from @Bloke and/or @bloatware to implement some of the above, as parts of it are beyond me. |
I'll take a look at this. Would someone please whip up some best-practice markup for the checkboxes with aria labels etc, so I can deconstruct that and fold it into the code. Thanks.
|
OK @Bloke, I have had a think about this, and here is what I think would work: <table class="txp-list">
<thead>
<tr>
<th class="txp-list-col-multi-edit" scope="col">
<label for="select_all" class="txp-accessibility">Bulk select all/none</label>
<input type="checkbox" value="0" name="select_all" id="select_all" aria-description="Currently 2 item(s) selected" aria-live="assertive"></th>
<th class="txp-list-col-id" scope="col">ID#</th>
<th class="txp-list-col-title" scope="col">Title</th>
</tr>
</thead>
<tbody>
<tr class="selected" aria-selected="true">
<td class="txp-list-col-multi-edit">
<label for="bulk_select-3" class="txp-accessibility">Bulk select row</label>
<input id="bulk_select-3" type="checkbox" class="checkbox" value="3" checked="checked">
</td>
<th class="txp-list-col-id" scope="row"><a href="#">3 [Edit]</a></th>
<td class="txp-list-col-title"><a href="#">Test article 3 title [Edit]</a></td>
</tr>
<tr class="selected" aria-selected="true">
<td class="txp-list-col-multi-edit">
<label for="bulk_select-2" class="txp-accessibility">Bulk select row</label>
<input id="bulk_select-2" type="checkbox" class="checkbox" value="2" checked="checked">
</td>
<th class="txp-list-col-id" scope="row"><a href="#">2 [Edit]</a></th>
<td class="txp-list-col-title"><a href="#">Test article 2 title [Edit]</a></td>
</tr>
<tr>
<td class="txp-list-col-multi-edit">
<label for="bulk_select-1" class="txp-accessibility">Bulk select row</label>
<input id="bulk_select-1" type="checkbox" class="checkbox" value="1">
</td>
<th class="txp-list-col-id" scope="row"><a href="#">1 [Edit]</a></th>
<td class="txp-list-col-title"><a href="#">Test article 1 title [Edit]</a></td>
</tr>
</tbody>
</table> So, breaking it down:
There's a couple of ARIA assumptions in the above, but without having it live I can't test the theory. |
Sweet, that looks grand. Thanks, Phil. Lots of this functionality will have to come from JavaScript so I might call on @bloatware for assistance there. But I'll give the markup a go first and then fold the JS in. Been reading up on aria-live. It says the element that announces things is set on an empty element. Our input control that checks all items isn't empty, so it may be that we need to move the live attribute and description to an adjacent element. Depends how strict the browsers are at interpreting things. I'm also not sure how easy it is to inject the value into a string on the fly. Presumably we do that already to populate the visible "with N selected" so it'll just be an extension of that. Can't remember if that's done client side with search n replace or it does a round trip to the server to get the string and then do the replacement from the string with its curly brace placeholders. Either way I expect we want to make that string as short as possible if it's going to be read aloud every time you check a box. There's also the consideration of singular/plural which have different rules for different languages and we can't rely on Also need to think about whether using Lots to think about so let's put a stake in the ground and iterate from there. |
Thanks Stef - my thinking behind using I guess having |
Yeah. Who knows what will happen. Let's try it out and find out! |
Both the multi-edit
select
widget and the associated checkboxes are currently completely un-labeled and are next to impossible to handle through AT.The
select
widget should have either alabel
(possibly hidden through the relevant CSS class) oraria-label
. The checkboxes should have either anaria-label
or aaria-labelledby
attribute to identify (name) them.With Firefox: Right-click / control-click on element, choose “Inspect Accessibility Properties” from the context menu. The accessibility inspector displays an angry red warning about the need for the element to be labeled.
Attached: screenshot from the Article pane with Firefox 107b Accessibility inspector
The text was updated successfully, but these errors were encountered: