Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Fields that are shown conditionally based on a select options field should be hidden by default, but if they are inside a fieldset that is "Collapsed by default", they are all shown until one of the select options is checked. This problem exists on a fresh install of Drupal with only core modules, the latest releases of cTools and Views, and Webform 7.x-4.7+20-dev.
Steps to reproduce
- Create a fieldset that is "Collapsible" and "Collapsed by default".
- Inside the fieldset, create a "Select Options" field with two options and no default value.
- Inside the fieldset, create two text fields.
- Create two conditions so that one of the text fields is shown when the first option is selected, and the other text field is shown when the other is selected.
- Navigate to the form and open the fieldset, both text fields will be shown. If you select one of the options, the appropriate text field will disappear correctly.
Comment | File | Size | Author |
---|---|---|---|
#2 | webform-conditionals_in_collapsed_fieldset-2467877-2.patch | 2.42 KB | DanChadwick |
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedExcellent report. Confirmed. Webform is confusing "hidden by conditional" with "hidden by collapsed fieldset". Ugh.
Comment #2
DanChadwick CreditAttribution: DanChadwick commentedActual visibility is no longer tested. Instead it looks for a class that means conditionally hidden in itself or any parent.
Committed to 7.x-4.x and 8.x.