-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#states does not properly hide title and description of checkboxes element #711
Comments
For the visibility state, states.js looks for the nearest .form-item, .form-submit, or .form-wrapper element and applies the appropriate display style to it. For issue #197, the theme_checkboxes and theme_radios functions were removed in previous commits in favor of theme_container. This introduced a form-wrapper div around the form item value but not the form item label (there's no label in a container). This pull request modifies theme_container to not add the form-wrapper class if $element['#type'] exists and does not equal container. |
Thanks @bt-eric for researching this one and finding the root cause. I'm not sure about the solution proposed. Perhaps we could use different attribute besides Would something like this work? if (empty($element['#attributes']['class'])) {
$element['#attributes']['class'][] = 'form-wrapper';
} Then if checkboxes or radios add a different class, they won't end up with the |
Let's try to fix this for the next bugfix release. |
I agree the check for an existing class is a better approach, and it works well. The pull request has been updated. |
Sweet. Thanks! I'll try giving this a manual go and see if it fixes the configuration display issues in Views, where this problem is most apparent. |
Confirmed this solves the problem in Views as well. It was apparent when using the "Content type" as an exposed filter, the list of content types to expose was a set of checkboxes whose title would never go away. This fixes the problem and the title is now hidden when the checkboxes are hidden. Nice one! Merged this in as a squashed commit backdrop/backdrop@c499829 into 1.x and 1.0.x. Thanks @bt-eric! |
I have the following form element:
When the display target element is toggled, the checkboxes correctly appear and disappear, but the element title and description are always visible. It looks like the
display:none
is being added to the wrong div.The text was updated successfully, but these errors were encountered: