From 0b6911113b42652ca6a1631448a0e0ae313d13e1 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Wed, 21 Jun 2023 01:52:16 +0000 Subject: [PATCH] Administration: Make checkbox column clickable. Change the `label` for `.check-column` inside list tables to a block filling the entire cell. Improves accessibility by increasing the target area for the control. Props mitchoyoshitaka, lessbloat, sabernhardt, ogleker, tacoverdo, joostdevalk, karmatosed. Fixes #21516. git-svn-id: https://develop.svn.wordpress.org/trunk@55954 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/list-tables.css | 22 +++++++++++++++++++ .../includes/class-wp-comments-list-table.php | 4 +++- .../includes/class-wp-links-list-table.php | 4 +++- src/wp-admin/includes/class-wp-list-table.php | 4 +++- .../includes/class-wp-media-list-table.php | 4 +++- .../includes/class-wp-ms-sites-list-table.php | 4 +++- .../class-wp-ms-themes-list-table.php | 6 +++-- .../includes/class-wp-ms-users-list-table.php | 4 +++- .../includes/class-wp-plugins-list-table.php | 2 +- .../includes/class-wp-posts-list-table.php | 4 +++- .../class-wp-privacy-requests-table.php | 8 ++++++- .../includes/class-wp-terms-list-table.php | 2 +- .../includes/class-wp-users-list-table.php | 2 +- src/wp-admin/update-core.php | 12 ++++++---- 14 files changed, 65 insertions(+), 17 deletions(-) diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css index 00a6d8c4a055f..2976d2f9821e7 100644 --- a/src/wp-admin/css/list-tables.css +++ b/src/wp-admin/css/list-tables.css @@ -552,6 +552,28 @@ th.asc a:focus span.sorting-indicator:before { content: "\f142"; } +.check-column { + position: relative; +} + +.check-column .label-covers-full-cell { + width: 100%; + height: 100%; + display: block; + position: absolute; + top: 0; + left: 0; +} + +.check-column .label-covers-full-cell input { + position: relative; + z-index: 1; +} + +.check-column .label-covers-full-cell:hover + input { + box-shadow: 0 0 0 1px #2271b1; +} + .locked-indicator { display: none; margin-left: 6px; diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 176b16718a1fb..c7dfcc61597e0 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -884,11 +884,13 @@ public function column_cb( $item ) { if ( $this->user_can ) { ?> -