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.56k stars 1.66k forks source link

autoSelectFirst is working not as expected #683

Closed abriginets closed 6 years ago

abriginets commented 6 years ago

Hi there. This issue is more likely an usage question. So, the thing is that I want not just pre-select first value in the suggestions list, but actually trigger it's selection like if user did it. For example, my user wants to find city Saint-Petersburg. If he enters the cityname correct with spelling respect it'll be selected automatically. triggerSelectOnValidInput is responsible for that. But what is user enters saint petersburg? Autocomplete will still understand what did user mean and propose him the same suggestions, but there will be no any autoselection triggering like in case with triggerSelectOnValidInput. Am I able to somehow select first suggestion value if user entered not a valid input and continued to fill some other inputs? I was unable to find any onClose or onLeave methods so I can't properly monitor if user closed suggestions list.

Thanks a lot in advance.

abriginets commented 6 years ago

For some reason Event function settings documentation is not provided on JQuery-Autocomplete's website. Just found it here on Github and successfully resolved my issue by myself.