diff --git a/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts b/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts index 24e5e65971..8a9040ca4d 100644 --- a/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +++ b/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts @@ -1,6 +1,7 @@ import { AfterViewInit, ChangeDetectionStrategy, + ChangeDetectorRef, Component, ElementRef, EventEmitter, @@ -65,6 +66,7 @@ export class AutocompleteComponent @Input() displayWithFn: (AutocompleteItem) => string = (item) => item + constructor(private cdRef: ChangeDetectorRef) {} ngOnChanges(changes: SimpleChanges): void { const { value } = changes if (value) { @@ -109,8 +111,8 @@ export class AutocompleteComponent } ngAfterViewInit(): void { - this.inputRef.nativeElement.focus() this.autocomplete.optionSelected.subscribe(this.selectionSubject) + this.cdRef.detectChanges() } ngOnDestroy(): void {