I’m using JQuery UI’s Autocomplete to load a list of users into a custom control and display them in the regular suggestion list. On page load, I’m calling this field’s search() method to populate the form with some initial data.
The problem is that the on page load event displays the suggestion list, as well as populating the custom control. How can I disable the suggestion list for the first query only?
I’ve tried monkey-patching various methods, and they either break or do nothing.
Of course, the alternative is setting a timeout on a function call to close it, but this will create an ugly flicker I’d like to avoid.
In the end, I overwrote Autocomplete’s _suggest method like so:
It’s not the most elegant solution, but it works.