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.
If a conditional field is within a fieldset, set to collapsed, the initial hidden state isn't respected.
Presumably jquery cant find the field since its parent element is already hidden.
Would putting "display: none", at the theme level, on the appropriate wrapper fix this?
Or can we change the order in which the fieldsets and cf javascript is executed?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#1 | conditional_fields_js_357558.patch | 5.9 KB | peterpoe |
Comments
Comment #1
peterpoe CreditAttribution: peterpoe commentedThis one was difficult: collapse.js toggles visibility of the content of a fieldset by adding and removing the 'collapsed' class that has a 'display: none' property attached to all contents. Since the field inside is already hidden by css, jQuery's hide() function didn't add a 'display: none' property to it. So I had to change it with a css('display', 'none') function.
Patch included. Note that the javascript has been reworked a bit to avoid duplication of code.
Comment #2
peterpoe CreditAttribution: peterpoe commentedCommitted to dev.
Comment #4
kenorb CreditAttribution: kenorb commentedThis patch caused this issue: #373954: doesn't work with content_profile_registration.module on Registration form
I've made the patch, which revert some changes from this committed patch.