diff --git a/core/modules/block/js/block.admin.js b/core/modules/block/js/block.admin.js index cc7b154..93d9229 100644 --- a/core/modules/block/js/block.admin.js +++ b/core/modules/block/js/block.admin.js @@ -43,17 +43,19 @@ function showBlockEntry (index, block) { if (query.length >= 2) { $blocks.each(showBlockEntry); - // Hide the category
if they don't have any visible rows. // Note that we first open all
to be able to use ':visible'. + // Mark the
elements that were closed before filtering, so + // they can be reclosed when filtering is removed. + $details.not('[open]').attr('data-drupal-block-state', 'forced-open'); + // Hide the category
if they don't have any visible rows. $details.attr('open', 'open').each(hideCategoryDetails); } else { $blocks.show(); $details.show(); - } - // Once the query is completely gone, close all details elements. - if (query.length === 0) { - $details.removeAttr('open'); + // Return
elements that had been closed before filtering + // to a closed state. + $details.filter('[data-drupal-block-state="forced-open"]').removeAttr('open data-drupal-block-state'); } }