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

suggestions don't show for first "tag" in an input with "," delimeter #732

Closed oshihirii closed 6 years ago

oshihirii commented 6 years ago

i am implementing this for a "comma separated tags" scenario.

when i go to an empty input for the first time, suggestions won't show for the first item i am looking for.

i think this is because the "," delimiter value does not preceed the first item.

my set up is:

$new_input.devbridgeAutocomplete({
tabDisabled: true,
lookup: tags,
minChars: 2,
delimiter: ",",
// catch select and clicking off the autocomplete box
onSelect: function(suggestion) {
this.focus();
console.log("devbridge onSelect");
},
onHide: function(suggestion) {
this.focus();
console.log("devbridge onHide");
},
});

how can i make suggestions show for that first item?

thanks.

tkirda commented 6 years ago

Delimiter has nothing to do here. You need to have at least two characters typed in your setup.