diff -u b/formatters/details/details.js b/formatters/details/details.js --- b/formatters/details/details.js +++ b/formatters/details/details.js @@ -26,6 +26,7 @@ // visible if children are visible. Drupal.FieldGroup.hideGroupIfEmpty($this, null, true); }); + // Check if Details Field Groups need to be hidden when the // "state:visible" event is fired. $(document).once('fieldgroup_details_state_visible').bind('state:visible', function(e) { diff -u b/formatters/fieldset/fieldset.js b/formatters/fieldset/fieldset.js --- b/formatters/fieldset/fieldset.js +++ b/formatters/fieldset/fieldset.js @@ -27,6 +27,7 @@ // visible if children are visible. Drupal.FieldGroup.hideGroupIfEmpty($this, null, true); }); + // Check if Fieldset Field Groups need to be hidden when the // "state:visible" event is fired. $(document).once('fieldgroup_fieldset_state_visible').bind('state:visible', function(e) { only in patch2: unchanged: --- a/formatters/html_element/html-element.js +++ b/formatters/html_element/html-element.js @@ -30,6 +30,20 @@ } } + // Hide this HTML element Field Group if children are not visible. + // HTML elements Field Groups do not have a "tab" and should always be + // visible if children are visible. + Drupal.FieldGroup.hideGroupIfEmpty($this, null, true); + }); + // Check if HTML element Field Groups need to be hidden when the + // "state:visible" event is fired. + $(document).once('fieldgroup_html_element_state_visible').bind('state:visible', function(e) { + if ($(e.target).hasClass('field-group-child-field')) { + let $group = $(e.target).closest('.field-group-details'); + if ($group.length !== 0) { + Drupal.FieldGroup.hideGroupIfEmpty($group, null, true); + } + } }); }, renderCollapsible: function ($wrapper) {