Select All/None of filter Checkboxes not compatible with Conditional Form Fields of the Form Api.

Created on 7 April 2023, over 1 year ago
Updated 31 May 2024, 3 months ago

Problem/Motivation

Select All/None of filter Checkboxes not compatible with Conditional Form Fields of the Form Api.

https://www.drupal.org/docs/drupal-apis/form-api/conditional-form-fields β†’

Steps to reproduce

Show the filter as checkboxes and add conditional form api features to the filter search form to hide and show fields based on these checkboxes selection. The changed event will not fire for any other checkbox than the first.

Proposed resolution

change the two lines in better_exposed_filters/js/bef_select_all_none.js => Drupal.behaviors.betterExposedFiltersSelectAllNone that contain
.find('input[type=checkbox]:first').change();
to
.find('input[type=checkbox]').change();
and work out a way of identifying if there will be a problem with spinning cursors and deal with that in different way

Remaining tasks

Work out a way of identifying if there will be a problem with spinning cursors and deal with that in different way, see the comment in the code

User interface changes

none

API changes

none

Data model changes

none

Workaround

Fire the changed event on the checkboxes yourself with a bit if inserted js that targets your checkbox thats needs this.

πŸ“Œ Task
Status

Closed: outdated

Version

6.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain JorisTheDrupalist

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

Comments & Activities

Production build 0.71.5 2024