From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 22 Oct 2025 17:27:39 +0000 (-0700) Subject: Fix: move hierarchical order logic in dropdown sorting (#11128) X-Git-Tag: v2.19.1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ebd9f24b5b9dbb0095c12691f3097f1105d6bfd;p=thirdparty%2Fpaperless-ngx.git Fix: move hierarchical order logic in dropdown sorting (#11128) --- diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts index 6107438da9..3ca6edc5c8 100644 --- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts +++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts @@ -114,13 +114,6 @@ export class FilterableDropdownSelectionModel { b.id == NEGATIVE_NULL_FILTER_VALUE) ) { return 1 - } - - // Preserve hierarchical order when provided (e.g., Tags) - const ao = (a as any)['orderIndex'] - const bo = (b as any)['orderIndex'] - if (ao !== undefined && bo !== undefined) { - return ao - bo } else if ( this.getNonTemporary(a.id) == ToggleableItemState.NotSelected && this.getNonTemporary(b.id) != ToggleableItemState.NotSelected @@ -143,6 +136,13 @@ export class FilterableDropdownSelectionModel { this.getDocumentCount(a.id) < this.getDocumentCount(b.id) ) { return 1 + } + + // Preserve hierarchical order when provided (e.g., Tags) + const ao = (a as any)['orderIndex'] + const bo = (b as any)['orderIndex'] + if (ao !== undefined && bo !== undefined) { + return ao - bo } else { return a.name.localeCompare(b.name) }