108055: add user input to tag list

(cherry picked from commit aac58e612d)
This commit is contained in:
Jens Vannerum
2023-11-08 12:00:46 +01:00
committed by github-actions[bot]
parent a758848146
commit e815b1d938

View File

@@ -89,6 +89,18 @@ export class DsDynamicTagComponent extends DsDynamicVocabularyComponent implemen
} }
}), }),
map((list: PaginatedList<VocabularyEntry>) => list.page), map((list: PaginatedList<VocabularyEntry>) => list.page),
// Add user input as last item of the list
map((list: VocabularyEntry[]) => {
if (list && list.length > 0) {
if (isNotEmpty(this.currentValue)) {
let vocEntry = new VocabularyEntry();
vocEntry.display = this.currentValue;
vocEntry.value = this.currentValue;
list.push(vocEntry);
}
}
return list;
}),
tap(() => this.changeSearchingStatus(false)), tap(() => this.changeSearchingStatus(false)),
merge(this.hideSearchingWhenUnsubscribed)); merge(this.hideSearchingWhenUnsubscribed));