diff --git a/frontend/app/shared/components/references/reference-dropdown.component.html b/frontend/app/shared/components/references/reference-dropdown.component.html index 54eb47cac..0457a0837 100644 --- a/frontend/app/shared/components/references/reference-dropdown.component.html +++ b/frontend/app/shared/components/references/reference-dropdown.component.html @@ -1,4 +1,4 @@ - + diff --git a/frontend/app/shared/components/references/reference-dropdown.component.ts b/frontend/app/shared/components/references/reference-dropdown.component.ts index 40e2fe676..4ae7c513b 100644 --- a/frontend/app/shared/components/references/reference-dropdown.component.ts +++ b/frontend/app/shared/components/references/reference-dropdown.component.ts @@ -39,7 +39,6 @@ const NO_EMIT = { emitEvent: false }; }) export class ReferenceDropdownComponent extends StatefulControlComponent | string> implements OnChanges { private readonly itemCount: number; - private selectedId: string | undefined; @Input() public language: LanguageDto; @@ -75,13 +74,13 @@ export class ReferenceDropdownComponent extends StatefulControlComponent { + .subscribe((id: string) => { if (this.control.enabled) { - if (value && value.id) { + if (id) { if (this.mode === 'Single') { - this.callChange(value.id); + this.callChange(id); } else { - this.callChange([value.id]); + this.callChange([id]); } } else if (this.mode === 'Single') { this.callChange(null); @@ -105,8 +104,6 @@ export class ReferenceDropdownComponent extends StatefulControlComponent { this.control.disable(NO_EMIT); @@ -135,26 +132,16 @@ export class ReferenceDropdownComponent extends StatefulControlComponent x.id === this.selectedId), NO_EMIT); - } - - private unselectContent() { - this.control.setValue(undefined, NO_EMIT); + private selectContent(value: any) { + this.control.setValue(value, NO_EMIT); } private createContentNames(contents: ReadonlyArray): ReadonlyArray {