devbridge / jQuery-Autocomplete

Ajax Autocomplete for jQuery allows you to easily create autocomplete/autosuggest boxes for text input fields
https://www.devbridge.com/sourcery/components/jquery-autocomplete/
Other
3.57k stars 1.67k forks source link

Prevent executing search onFocus #838

Closed fuxifex closed 2 years ago

fuxifex commented 2 years ago

When autocomplete is showing the suggestions (with focus on the textbox) and it's losing focus, eg. by clicking on the DevTools, the suggestions are being closed (which is ok) - and when clicking somewhere on the document again it will trigger a (unwanted) search again. Is there a way to avoid this behaviour? when getting the focus back in the text box it should show the suggestions without searching (as nothing has changed).

tkirda commented 2 years ago

I see that you are looking for a way to optimize it. Suggestions should be quick and it should not be an issue. Also, response for the similar query can be cached.