Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Performance: Enable virtual scrolling for large custom field selects (#10708)

david-loed9459ac37f71
diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html
index 57aff1bd9..22a1eec2e 100644
--- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html
+++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html
@@ -51,6 +51,7 @@
<ng-select #fieldSelects
class="paperless-input-select rounded-end"
[items]="getSelectOptionsForField(atom.field)"
+ [virtualScroll]="getSelectOptionsForField(atom.field)?.length > 100"
bindLabel="label"
bindValue="id"
[(ngModel)]="atom.value"
diff --git a/src-ui/src/app/components/common/input/select/select.component.html b/src-ui/src/app/components/common/input/select/select.component.html
index ef7be3b62..7aa4ef94a 100644
--- a/src-ui/src/app/components/common/input/select/select.component.html
+++ b/src-ui/src/app/components/common/input/select/select.component.html
@@ -19,6 +19,7 @@
[class.private]="isPrivate"
[clearable]="allowNull"
[items]="items"
+ [virtualScroll]="items?.length > 100"
[addTag]="allowCreateNew && addItemRef"
addTagText="Add item"
i18n-addTagText="Used for both types, correspondents, storage paths"