From 573b2f606a169c8de47331e7a6d6b581f694adcc Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 31 Mar 2025 18:50:20 -0700 Subject: [PATCH] Fix bind value --- .../common/input/document-link/document-link.component.html | 3 +-- .../common/input/document-link/document-link.component.ts | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/components/common/input/document-link/document-link.component.html b/src-ui/src/app/components/common/input/document-link/document-link.component.html index 4a7e096d9..6eb380f10 100644 --- a/src-ui/src/app/components/common/input/document-link/document-link.component.html +++ b/src-ui/src/app/components/common/input/document-link/document-link.component.html @@ -30,14 +30,13 @@ [placeholder]="placeholder" [notFoundText]="notFoundText" [multiple]="true" - bindValue="id" [compareWith]="compareDocuments" [trackByFn]="trackByFn" [minTermLength]="2" [loading]="loading" [typeahead]="documentsInput$" (mousedown)="$event.stopImmediatePropagation()" - (change)="onChange(selectedDocuments)"> + (change)="onChange(selectedDocumentIDs)">
@if (!disabled) { diff --git a/src-ui/src/app/components/common/input/document-link/document-link.component.ts b/src-ui/src/app/components/common/input/document-link/document-link.component.ts index a9e6f115a..c5b613ba4 100644 --- a/src-ui/src/app/components/common/input/document-link/document-link.component.ts +++ b/src-ui/src/app/components/common/input/document-link/document-link.component.ts @@ -71,6 +71,10 @@ export class DocumentLinkComponent @Input() placeholder: string = $localize`Search for documents` + get selectedDocumentIDs(): number[] { + return this.selectedDocuments.map((d) => d.id) + } + constructor(private documentsService: DocumentService) { super() }