Skip to content
This repository was archived by the owner on Nov 22, 2021. It is now read-only.

Issue: debounce causes autocomplete to be a letter behind if promise resolves instantly #135

Closed
funkjunky opened this issue Apr 26, 2014 · 1 comment

Comments

@funkjunky
Copy link

If you set debounce-delay=0 and your promise returns immediately without any ajax, then the result list will be one letter behind.

Looking at the code this makes perfect sense, because you debounce the promise function, then call show immediately after. The debounced function can't possibly resolve before show is called.

There either needs to be a way to disable the debounce, or call show after resolving the promise given in the source option.

@funkjunky
Copy link
Author

My bad. The issue doesn't occur with $q promises... they must be doing some kind of delay action or something, because it magically works if I use a $q promise instead of my promise object with a then method.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant