diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts index 9463b04ea..d9a1973d5 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -511,7 +511,7 @@ export class BulkEditorComponent : 'originals' this.documentService .bulkDownload( - Array.from(this.list.selected), + this.list.getSelectedInOrder(), downloadFileType, this.downloadForm.get('downloadAsSingleFile').value, this.downloadForm.get('downloadUseFormatting').value diff --git a/src-ui/src/app/services/document-list-view.service.ts b/src-ui/src/app/services/document-list-view.service.ts index 4fb2cda02..13bbac197 100644 --- a/src-ui/src/app/services/document-list-view.service.ts +++ b/src-ui/src/app/services/document-list-view.service.ts @@ -358,6 +358,12 @@ export class DocumentListViewService { return this.activeListViewState.selected } + getSelectedInOrder(): number[] { + return this.activeListViewState.documents + .filter((item) => this.activeListViewState.selected.has(item.id)) + .map((item) => item.id) + } + setSort(field: string, reverse: boolean) { this.activeListViewState.sortField = field this.activeListViewState.sortReverse = reverse