Skip to content

Commit

Permalink
fix: improve performance of filter selectors (#1399)
Browse files Browse the repository at this point in the history
See #1387
This PR improves the performance of filter selectors by adding lazy loading and rendering only when they are visible.
  • Loading branch information
leiyre committed Apr 11, 2022
1 parent e1ebff2 commit b6a8eae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions frontend/components/commons/header/filters/FiltersList.vue
Expand Up @@ -47,19 +47,19 @@
)"
:key="filter.id"
>
<SelectFilter
<lazy-select-filter
v-if="filter.type === 'select'"
class="filter"
:filter="filter"
@apply="onApply"
/>
<FilterScore
<lazy-filter-score
v-else-if="filter.type === 'score'"
class="filter"
:filter="filter"
@apply="onApply"
/>
<FilterUncoveredByRules
<lazy-filter-uncovered-by-rules
v-else-if="showUncoveredByRulesFilter"
class="filter"
:filter="filter"
Expand All @@ -76,7 +76,7 @@
@click.prevent="removeFiltersByGroup(group)"
>Remove all filters</a
>
<SortList
<lazy-sort-list
v-if="initialVisibleGroup === 'Sort'"
:sort-options="filterList"
:sort="dataset.sort"
Expand Down
Expand Up @@ -48,7 +48,7 @@
{{ filter.placeholder }}
</span>
</span>
<div slot="dropdown-content">
<div slot="dropdown-content" v-if="visible">
<input
v-model="searchText"
class="filter-options"
Expand Down
1 change: 1 addition & 0 deletions frontend/components/core/ReCheckbox.vue
Expand Up @@ -172,6 +172,7 @@ $checkbox-color-dark: $primary-color;
padding-right: 2em;
white-space: normal;
text-transform: none;
word-break: break-all;
}
}
Expand Down

0 comments on commit b6a8eae

Please sign in to comment.