WP-API / new-list-tables

An experiment in re-writing the post list screen using the REST API.
GNU General Public License v2.0
71 stars 17 forks source link

The check row checkbox should be labeled #4

Closed afercia closed 7 years ago

afercia commented 7 years ago

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>

rmccue commented 7 years ago

👍 Will add this momentarily.

not wrapping, using for/id attributes

Curious to know why this is the case?

afercia commented 7 years ago

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.

rmccue commented 7 years ago

Makes sense. 👍