Closed afercia closed 7 years ago
👍 Will add this momentarily.
not wrapping, using for/id attributes
Curious to know why this is the case?
Curious to know why this is the case?
In the past months, in the accessibility team we've tested and researched on this topic and association with for/id is the one with best support across browsers/assistive technologies combos.
Makes sense. 👍
Currently, the checkbox to select a list table row has no label.The rendered markup is:
<th class="check-column" scope="row"><input type="checkbox" value="on"></th>
It should have an explicitly associated label (not wrapping, using for/id attributes), see https://make.wordpress.org/core/handbook/best-practices/coding-standards/accessibility-coding-standards/#labeling for/id attributes are required to maximize assistive technologies support, since implicitly associated labels are not well supported in some cases. I understand this means there's the need to generate unique IDs but if we're going to use JS frameworks in core then we should really find a nice way to have unique IDs.
Worth noting in other list tables in WordPress, for example the Posts one, this label includes a reference to the specific post, e.g.:
<label class="screen-reader-text" for="cb-select-1">Select Hello world!</label>