From 9d5730572cc3b5edde3ea158c48e98938f6abea8 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Wed, 8 Nov 2023 10:57:42 +0100 Subject: [PATCH] feat(libs): Focus search field and resolve expression has changed after it was checked - error --- libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts b/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts index 2442fe4c83..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) { @@ -110,6 +112,7 @@ export class AutocompleteComponent ngAfterViewInit(): void { this.autocomplete.optionSelected.subscribe(this.selectionSubject) + this.cdRef.detectChanges() } ngOnDestroy(): void {