diff --git a/src/app/components/autocomplete/autocomplete.ts b/src/app/components/autocomplete/autocomplete.ts index 0d445b37bba..033370dab88 100644 --- a/src/app/components/autocomplete/autocomplete.ts +++ b/src/app/components/autocomplete/autocomplete.ts @@ -238,7 +238,11 @@ export class AutoComplete implements AfterViewChecked,AfterContentInit,DoCheck,C ngAfterViewChecked() { //Use timeouts as since Angular 4.2, AfterViewChecked is broken and not called after panel is updated if (this.suggestionsUpdated && this.overlay && this.overlay.offsetParent) { - setTimeout(() => this.alignOverlay(), 1); + setTimeout(() => { + if (this.overlay) { + this.alignOverlay(); + } + }, 1); this.suggestionsUpdated = false; }