Skip to content

Commit

Permalink
fix: only expand tree's with matches (#1252)
Browse files Browse the repository at this point in the history
Co-authored-by: René Schleusner <schleusner@sitepark.com>
  • Loading branch information
LeBenLeBen and René Schleusner committed Jan 26, 2023
1 parent fc17314 commit 9e881f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/mandelbrot/assets/js/components/search.js
Expand Up @@ -68,8 +68,11 @@ export default class Search {
const tagAttributesMatch = tagAttributes.toUpperCase().indexOf(key) !== -1;

if (
// Always show item with match
$li.has('mark').length ||
$li.parents('.Tree-collection').has('mark').length ||
// When the direct parent collection label matches
$li.closest('.Tree-collection').find('> .Tree-collectionLabel').has('mark').length ||
// When the root collection label matches
$li.parents('.Tree').find('.Tree-title').has('mark').length ||
tagAttributesMatch
) {
Expand Down

0 comments on commit 9e881f8

Please sign in to comment.