|
|
@ -77,7 +77,7 @@ export class GfTagsSelectorComponent |
|
|
this.tagInputControl.valueChanges |
|
|
this.tagInputControl.valueChanges |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
.subscribe((value) => { |
|
|
.subscribe((value) => { |
|
|
this.filteredOptions.next(this.filterTags(value)); |
|
|
this.filteredOptions.next(this.filterTags(value ?? '')); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
addIcons({ addCircleOutline, closeOutline }); |
|
|
addIcons({ addCircleOutline, closeOutline }); |
|
|
@ -100,21 +100,24 @@ export class GfTagsSelectorComponent |
|
|
|
|
|
|
|
|
if (!tag && this.hasPermissionToCreateTag) { |
|
|
if (!tag && this.hasPermissionToCreateTag) { |
|
|
tag = { |
|
|
tag = { |
|
|
id: undefined, |
|
|
id: '', |
|
|
name: event.option.value as string, |
|
|
name: event.option.value as string, |
|
|
userId: null |
|
|
userId: null |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.tagsSelected.update((tags) => { |
|
|
if (tag) { |
|
|
return [...(tags ?? []), tag]; |
|
|
this.tagsSelected.update((tags) => { |
|
|
}); |
|
|
return [...(tags ?? []), tag]; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const newTags = this.tagsSelected(); |
|
|
|
|
|
this.onChange(newTags); |
|
|
|
|
|
this.onTouched(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const newTags = this.tagsSelected(); |
|
|
|
|
|
this.onChange(newTags); |
|
|
|
|
|
this.onTouched(); |
|
|
|
|
|
this.tagInput.nativeElement.value = ''; |
|
|
this.tagInput.nativeElement.value = ''; |
|
|
this.tagInputControl.setValue(undefined); |
|
|
this.tagInputControl.setValue(null); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onRemoveTag(tag: Tag) { |
|
|
public onRemoveTag(tag: Tag) { |
|
|
|