diff --git a/libs/ui/src/lib/tags-selector/tags-selector.component.ts b/libs/ui/src/lib/tags-selector/tags-selector.component.ts index 62e3bb674..77c776ece 100644 --- a/libs/ui/src/lib/tags-selector/tags-selector.component.ts +++ b/libs/ui/src/lib/tags-selector/tags-selector.component.ts @@ -50,9 +50,9 @@ export class GfTagsSelectorComponent implements OnInit, OnChanges, OnDestroy { @ViewChild('tagInput') tagInput: ElementRef; public filteredOptions: Subject = new BehaviorSubject([]); + public readonly separatorKeysCodes: number[] = [COMMA, ENTER]; public readonly tagInputControl = new FormControl(''); public readonly tagsSelected = signal([]); - public readonly separatorKeysCodes: number[] = [COMMA, ENTER]; private unsubscribeSubject = new Subject(); @@ -74,11 +74,6 @@ export class GfTagsSelectorComponent implements OnInit, OnChanges, OnDestroy { this.updateFilters(); } - public ngOnDestroy() { - this.unsubscribeSubject.next(); - this.unsubscribeSubject.complete(); - } - public onAddTag(event: MatAutocompleteSelectedEvent) { const tag = this.tagsAvailable.find(({ id }) => { return id === event.option.value; @@ -104,6 +99,11 @@ export class GfTagsSelectorComponent implements OnInit, OnChanges, OnDestroy { this.updateFilters(); } + public ngOnDestroy() { + this.unsubscribeSubject.next(); + this.unsubscribeSubject.complete(); + } + private filterTags(query: string = ''): Tag[] { const tags = this.tagsSelected() ?? []; const tagIds = tags.map(({ id }) => {