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

onSearchComplete triggers after onSelect when only one match exists #852

Open diegosps opened 8 months ago

diegosps commented 8 months ago

When the behavior described in #846 happens (only one suggestion with exact match), the order of the events are swapped.

For example, if I have logic the does some cleanup at search complete and do some processing at select, whenever I click in an already filled input, I always end up with a clear state because onSearchComplete triggers after the onSelect event.

I can do some checks to avoid the cleanup.