Add missing classes to checkbox widget so it renders correctly

Created on 4 June 2025, about 1 month ago

Problem/Motivation

Several classes are missing from the standard output of the checkbox widget:

  • LI items need "js-form-item js-form-type-checkbox checkbox form-check".
  • Checkbox input fields need "form-checkbox form-check-input".
  • Labels need "form-check-label".

This would be a simpler approach to resolving πŸ› Render using theme input and select instead of lists with links for checkboxes and dropdown Needs review and might be a step in the right direction while waiting for the bigger fix to be finished.

Steps to reproduce

Compare the final output of the JS-powered checkbox widget with a regular checkbox field - several classes are missing.

Proposed resolution

Add the standard Drupal classes to the checkbox widget output.

Remaining tasks

Provide a working MR.

User interface changes

Checkboxes from the checkbox widget will pick up the standard CSS for regular FormAPI checkbox.

API changes

n/a

Data model changes

n/a

✨ Feature request
Status

Active

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States damienmckenna NH, USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024