Really strange issue: we had the ngx-bootstrap typeahead working for a long time, recently we've experienced behaviour where the drop down options are not shown until you click the mouse (can be anywhere on the page)
The typeahead is bound to an API (HttpClient) and the typeahead loading event shows that it's finished but no results are shown until you click somewhere.
<input [(ngModel)]="asyncSelected"
[typeaheadAsync]="true"
[typeahead]="departureAirports"
(typeaheadLoading)="changeTypeaheadLoading($event)"
(typeaheadOnSelect)="typeaheadOnSelect($event)"
[typeaheadOptionsLimit]="7"
typeaheadOptionField="name"
[typeaheadMinLength]="3"
placeholder="Locations loaded with timeout"
class="form-control">
<div *ngIf="typeaheadLoading">Loading</div>
this.departureAirports = this.getAirports('departure');
public getAirports(direction: string): Observable<Airport[]> {
const url = 'xxxxxx';
return this.httpClient.get(url).pipe(take(1), map((response: AirportsResponse) => response.Options ))
}
If I replace the httpClient with an array wrapped in an observable (using of) there is no issue.
We're using angular 8.2.14 with rxjs 6.5.3