Skip to content

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

Performance: re-enable virtual scroll, bump ng-select (#11279)

shamoon2a4e8f9acd98
diff --git a/src-ui/package.json b/src-ui/package.json
index e75aa3a24..2589a048c 100644
--- a/src-ui/package.json
+++ b/src-ui/package.json
@@ -21,7 +21,7 @@
"@angular/platform-browser-dynamic": "~20.3.2",
"@angular/router": "~20.3.2",
"@ng-bootstrap/ng-bootstrap": "^19.0.1",
- "@ng-select/ng-select": "^20.2.2",
+ "@ng-select/ng-select": "^20.6.3",
"@ngneat/dirty-check-forms": "^3.0.3",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.8",
diff --git a/src-ui/pnpm-lock.yaml b/src-ui/pnpm-lock.yaml
index 5c75a1419..13a84f1c2 100644
--- a/src-ui/pnpm-lock.yaml
+++ b/src-ui/pnpm-lock.yaml
@@ -39,8 +39,8 @@ importers:
specifier: ^19.0.1
'@ng-select/ng-select':
- specifier: ^20.2.2
+ specifier: ^20.6.3
'@ngneat/dirty-check-forms':
specifier: ^3.0.3
@@ -2356,9 +2356,9 @@ packages:
'@popperjs/core': ^2.11.8
rxjs: ^6.5.3 || ^7.4.0
- '@ng-select/[email protected]':
- resolution: {integrity: sha512-7mctt04/q9yquE4Ec1dQG+SkY6fZ2BQnJLsWmb05TCxYKAYAzDrDTgJJruPDuWrpYx+f3SwejpaI+z/GDrwYdw==}
- engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0}
+ '@ng-select/[email protected]':
+ resolution: {integrity: sha512-+aX2l3OshyPsyMCAuiA3ND5c6X1DG5jQjdlP8PBIyYEoQWlxEcgJWrMsPa7mHVFRpp+5KZZhnXhyosUE4CEc3w==}
+ engines: {node: ^22.12.0 || >=24.0.0}
peerDependencies:
'@angular/common': ^20.0.0
'@angular/core': ^20.0.0
@@ -9413,7 +9413,7 @@ snapshots:
rxjs: 7.8.2
tslib: 2.8.1
dependencies:
'@angular/core': 20.3.2(@angular/[email protected])([email protected])([email protected])
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 a8973e702..7761ecb89 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
@@ -63,6 +63,7 @@
bindValue="id"
[(ngModel)]="atom.value"
[disabled]="disabled"
+ [virtualScroll]="getSelectOptionsForField(atom.field)?.length > 100"
(mousedown)="$event.stopImmediatePropagation()"
></ng-select>
} @else if (getCustomFieldByID(atom.field)?.data_type === CustomFieldDataType.DocumentLink) {
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 eb351cbe6..3cfbfe330 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
@@ -29,6 +29,7 @@
[multiple]="multiple"
[bindLabel]="bindLabel"
bindValue="id"
+ [virtualScroll]="items?.length > 100"
(change)="onChange(value)"
(search)="onSearch($event)"
(focus)="clearLastSearchTerm()"
diff --git a/src-ui/src/app/components/common/input/tags/tags.component.spec.ts b/src-ui/src/app/components/common/input/tags/tags.component.spec.ts
index 3c69fbade..84f1c4817 100644
--- a/src-ui/src/app/components/common/input/tags/tags.component.spec.ts
+++ b/src-ui/src/app/components/common/input/tags/tags.component.spec.ts
@@ -138,7 +138,7 @@ describe('TagsComponent', () => {
settingsService.currentUser = { id: 1 }
let activeInstances: NgbModalRef[]
modalService.activeInstances.subscribe((v) => (activeInstances = v))
- component.select.searchTerm = 'foobar'
+ component.select.filter('foobar')
component.createTag()
expect(modalService.hasOpenModals()).toBeTruthy()
expect(activeInstances[0].componentInstance.object.name).toEqual('foobar')
diff --git a/src-ui/src/app/components/common/input/tags/tags.component.ts b/src-ui/src/app/components/common/input/tags/tags.component.ts
index 323d3ddf1..4546dabcb 100644
--- a/src-ui/src/app/components/common/input/tags/tags.component.ts
+++ b/src-ui/src/app/components/common/input/tags/tags.component.ts
@@ -169,7 +169,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
if (name) modal.componentInstance.object = { name: name }
else if (this.select.searchTerm)
modal.componentInstance.object = { name: this.select.searchTerm }
- this.select.searchTerm = null
+ this.select.filter(null)
this.select.detectChanges()
return firstValueFrom(
(modal.componentInstance as TagEditDialogComponent).succeeded.pipe(