Bulk action checkboxes turn into toggle when combined with tabledrag

Created on 6 April 2023, over 1 year ago
Updated 14 July 2023, over 1 year ago

Problem/Motivation

Gin converts checkboxes to toggle icons. This is not wanted in case of checkboxes for bulk actions (like views bulk actions). Gin already has a selector query to prevent this:

:not(.form-checkboxes):not(td):not(.media-library-item__click-to-select-checkbox):not(.field-content) > .form-type--checkbox *

However, when used together with a table with a drag handler, the drag handler injects itself into the row's first <td> and wraps the existing content inside an <div class="tabledrag-cell-content__item">. It is very common to place the bulk select checkbox into the first column, so the checkbox gets wrapped inside that div, and the exclusion selector :not(td) > .form-type--checkbox no longer applies.

Steps to reproduce

Create a node view with bulk actions.
Move the checkboxes into the first column.
Add a tabledrag handler (e.g. by using weight module , add weight field to node and add a weight selector field to view)
Checkboxes are no rendered as toggle images.

Proposed resolution

Include wrapping class selector used by core/drupal.tabledrag library .tabledrag-cell-content__item into the selector exclusion query:

:not(.form-checkboxes):not(td):not(.tabledrag-cell-content__item):not(.media-library-item__click-to-select-checkbox):not(.field-content) > .form-type--checkbox *
🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇦🇹Austria hudri Austria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024