-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Hello,
I am having trouble with using the generated checkboxes when using a screen reader to navigate
since the checkboxes are rendered without labels or any aria what so ever:
<input type="checkbox" class="dt-checkboxes">
It is really hard to know what am I checking.
Maybe this could be improved by giving more information in the generated checkboxes attributes.
I have an idea that could help although I have no idea how to implement it.
First giving a name to the column, like it can be empty but I could also want to call it "select someone" : that way we can link the name of the column with the line Id.
Then we could generate something like:
<td class=" dt-checkboxes-cell">
<label for="lineID" class="sr-only"> lineID</label>
<input name="lineID" type="checkbox" class="dt-checkboxes" aria-checked="false">
</td>
Thus upon selecting the checkbox the screen reader would say stuff stuff like "selected line one" if "line one" is my ID or selected "Airi Satou" if my table uses people names as ID....something like that.
or:
<td class=" dt-checkboxes-cell">
<input type="checkbox" class="dt-checkboxes" aria-labelledby="lineID ColumnName">
</td>
Anyway, I'm still lacking a lot so this idea might not be of much help.
Here there are some example of best practises for checkboxes (althought these need to be fitted in the table context) : https://www.w3.org/TR/2016/WD-wai-aria-practices-1.1-20160317/examples/checkbox/checkbox-2.html
notes:
sr-only is the class used by Bootstrap to hide info so that it is only "visible" to non sighted users.
aria-checked="false" helps knowing what is checked
Thank you for your hard work