diff --git a/src/app/components/autocomplete-select/autocomplete-select.component.html b/src/app/components/autocomplete-select/autocomplete-select.component.html index e51b5f2..4f528f8 100644 --- a/src/app/components/autocomplete-select/autocomplete-select.component.html +++ b/src/app/components/autocomplete-select/autocomplete-select.component.html @@ -12,7 +12,7 @@ {{ nameToShowInSelection(object) }} diff --git a/src/app/components/autocomplete-select/autocomplete-select.component.ts b/src/app/components/autocomplete-select/autocomplete-select.component.ts index eef16e9..4a8cd97 100644 --- a/src/app/components/autocomplete-select/autocomplete-select.component.ts +++ b/src/app/components/autocomplete-select/autocomplete-select.component.ts @@ -68,13 +68,14 @@ export class AutocompleteSelectComponent implements OnInit { .valueChanges.subscribe(() => this.filterPossibleObjects()); } - onOptionClicked(event: Event, element: any, trigger: MatAutocompleteTrigger) { - event.stopPropagation(); + onOptionSelected(element: any, trigger: MatAutocompleteTrigger) { if (this.keepAutocompleteOpenAfterClick) { trigger.openPanel(); } - this.addForm.get('addGroup').reset(); + this.addForm.get('addGroup').setValue(''); this.selectedElementChange.emit(element); + + this.filterPossibleObjects(); } filterPossibleObjects() {