I have a small example like on this Fiddle. Simple Bootstrap tokeninput using autocomplete.
$(document).ready(function() {
$('#tokenfield').tokenfield({
autocomplete: {
source: ['red','blue','green','yellow','violet','brown','purple','black','white'],
delay: 100
},
showAutocompleteOnFocus: true
});
});
By default, after selecting a token the input will still be focused, and the autocomplete is only going to auto-popup again if I focus out and in to the input field.
I would like to be able to reopen the autocomplete options once I entered a token.
I was thinking to try using the tokenfield:createtoken
event to lose and gain focus of the input again, but that won't give the autocomplete dropdown.
$('#tokenfield').on('tokenfield:createtoken', function (e) {
console.log('FOCUS IN AND OUT');
$('#tokenfield-tokenfield').blur();
$('#tokenfield-tokenfield').focus();
});
Other idea was to try using the search
function autocomplete-ui.
$('#tokenfield').on('tokenfield:createtoken', function (e) {
console.log('TRY AUTOCOMPLETE SEARCH');
$('#tokenfield-tokenfield').autocomplete('search', '');
});
No luck with that either. Pls Help! Thanks! JSFiddle Here