When checking a child, the parents are automatically selected. When this happens, the code looks from the parent and checks all the boxes down to the child. To do this, is uses this code:
checkbox.parents('ul.term-reference-tree-level li').children('div.form-item').children('input[type=checkbox]').each(function() {
However, this is too brittle. For instance, bootstrap puts checkboxes within label elements. So, we should use find for the inputs, not children. e.g.
checkbox.parents('ul.term-reference-tree-level li').children('div.form-item').find('input[type=checkbox]').each(function() {
Patch attached.
Comments
Comment #1
dave reidComment #1.0
dave reidtypo
Comment #2
duaelfrRerolled.
Be careful, this patch conflicts with the one posted in #2271719-3: Broken when using jQuery 1.9 and 1.10
Comment #3
vladimirausThank you everyone for your contribution.
Drupal 7 is no longer supported but we always need support for Drupal 11 version.
Closing as outdated.