Closed diogotrentini closed 9 years ago
Thanks @diogotrentini. What's the use case for this? I'd argue that the typeahead should be closed if the field loses focus.
Hi @jbrowning! It's happening while waiting for a async request (that's why I put a $timeout on the plunker, so I can simulate a async function). So the use case is something like this: I'm fetching via AJAX the items that I want to display on typeahead and using typeahead-loading
to show a spinner. If I focus out when the AJAX is still running, the spinner will not hide (typahead-loading
will not update, ever).
Got it. Makes sense. I would also test that typeahead-loading
is set to false if the promise is rejected because this change causes that too.
Sorry for the delay. Actually, isLoadingSetter(originalScope, false);
was being called on the promise's rejection, even before this update. Even though I added a test, just to make sure (and because there aren't tests about this case). (:
Looks great. Thanks! :+1:
Hey guys!
I found a bug on the typeahead directive: it's not updating the loading callback if the input field loses focus. You can test it on http://plnkr.co/edit/VZOjJLO4nZ5HMWXrl9Wc?p=preview, just type something and immediately focus out. I just changed when the directive updates the loading callback and it's working. :smile: