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).
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.
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).