typeahead-loading stuck on true when editable = false and focus is lost while loading
Bug description:
If typeahead is editable=false and focus is lost during loading, typeahead-loading get stuck on "true".
Link to minimally-working plunker that reproduces the issue:
https://plnkr.co/edit/pmEfFVWkekOeqYHgYhFZ?p=preview
Version of Angular, UIBS, and Bootstrap
Angular: 1.5.8 UIBS: 2.2.0 Bootstrap: 3.3.7
+1
Any update on this bug? It's still occurringin 1.1.2
+1
+1 as I am able to reproduce this quite often and seems to be very annoying to our clients
As workaround, I tried to set the loading variable to false once I've got the data from server. In the same time, I used a cancel request logic onBlur and e.target.value is empty string. It works.
`searchCompanies(value) { const ctrl = this;
this.companySearchCanceller.resolve();
this.companySearchCanceller = this.$q.defer();
return this.ApiService.searchCompanies(
{
country: ctrl.search.country,
term: value
},
ctrl.companySearchCanceller.promise
).then((response) => {
this.loadingCompanies = false;
return response.data.data;
}, (error) => {
//Handle aborted requests to avoid no results popup
if (error.status === -1) {
ctrl.noCompanies = false;
}
this.loadingCompanies = false;
});
}
onBlur($e) {
if ($e.target.value.length === 0) {
this.companySearchCanceller.resolve();
this.loadingCompanies = false;
}
}`