Add a sortable checkboxes widget (tableselect) as OptionsButtonsWidget alternative

Created on 15 November 2024, about 1 month ago

Problem/Motivation

OptionsButtonsWidget provides the

Check boxes/radio buttons

field widget.

Sadly, in contrast to EntityReferenceAutocompleteWidget those checkboxes / radios are not sortable, while they are still stored with delta value in the database already.
Switching to EntityReferenceAutocompleteWidget is not an option for UX reasons often, if you want to show all available options to the user.

So currently you don't have best of both worlds combined in the UI for the user as widget:

As Drupal already provides the wonderful tableselect FAPI element and already stores the delta in database, it should be relatively easy and benefitial to provide a "Sortable check boxes/radio buttons" widget in core.

Steps to reproduce

Proposed resolution

Provide a "Sortable check boxes/radio buttons" widget in core to allow not only (bulk) checking checkboxes option but also allow sorting the values (delta) if needed.

Remaining tasks

  1. Discuss
  2. Implement
  3. Test
  4. Release

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component

forms system

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

Production build 0.71.5 2024