Skip to content

Commit b6479b2

Browse files
author
Derek Liang
committed
Enhance change detection in Typeahead components by marking for check on updates
1 parent 7fb1f2d commit b6479b2

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/typeahead/typeahead-container.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,15 @@ export class TypeaheadContainerComponent implements OnDestroy {
154154

155155
if (concurrency) {
156156
this.selectActive(concurrency);
157+
this.changeDetectorRef.markForCheck();
157158

158159
return;
159160
}
160161

161162
this.active = void 0;
162163
}
164+
165+
this.changeDetectorRef.markForCheck();
163166
}
164167

165168
get isTopPosition(): boolean {
@@ -384,6 +387,7 @@ export class TypeaheadContainerComponent implements OnDestroy {
384387
preview = value;
385388
}
386389
this.parent?.typeaheadOnPreview.emit(preview);
390+
this.changeDetectorRef.markForCheck();
387391
}
388392

389393
private isScrolledIntoView(elem: HTMLElement): boolean {

src/typeahead/typeahead.directive.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ export class TypeaheadDirective implements OnInit, OnDestroy {
582582

583583
this._container.query = this.tokenizeQuery(normalizedQuery);
584584
this._container.matches = this._matches;
585+
this.changeDetection.markForCheck();
585586
} else {
586587
this.show();
587588
}

0 commit comments

Comments
 (0)