Checkboxes fields are no longer hidden

Created on 19 January 2024, about 1 year ago

Problem/Motivation

🐛 If target field is multiple checkbox and condition is required then all checkboxes are being required. Fixed broke a visible condition on a checkboxes field for us.
Before, the state (visible, required, etc.) was applied to every checkbox.
Now, the state is not applied to individual checkboxes.
For conditions that add/remove the required state, this is intended and the required property is now added to the parent field wrapper by js/conditional_fields.js.
But for conditions that add/remove the visible state, it means the checkboxes are no longer hidden.

Steps to reproduce

  1. Create a bundle with a checkbox field and a checkboxes field.
  2. Use conditional_field to add a condition that hides the checkboxes field when the other checkbox field is checked.
  3. The checkboxes are not hidden correctly.

Proposed resolution

ConditionalFieldsElementAlterHelper::afterBuild() should only do nothing on children when the condition triggers a required state.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇫🇷France prudloff Lille

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