dragonofmercy / Tokenize2

Tokenize2 is a plugin which allows your users to select multiple items from a predefined list or ajax, using autocompletion as they type to find each item. You may have seen a similar type of text entry when filling in the recipients field sending messages on facebook or tags on tumblr.
https://dragonofmercy.github.io/Tokenize2/
BSD 3-Clause "New" or "Revised" License
83 stars 25 forks source link

Display Dropdown on focus? #12

Closed sebackend closed 7 years ago

sebackend commented 7 years ago

Hi there, thanks so much for this plugin, i really love it :smile:

I was looking for the option present in the previous version displayDropdownOnFocus but can´t find something similar in the project page

Could you include it in the future?

Thanks!

dragonofmercy commented 7 years ago

Hi ! You can do like this:

$('.tokenize-sample-demo1').on('tokenize:select', function(container){
    $(this).tokenize2().trigger('tokenize:search', [$(this).tokenize2().input.val()]);
});
aberel commented 7 years ago

Hi, I was looking the same old option "displayDropdownOnFocus", now I found your response. It wouldn't be better to add this code inside the plugin? Just like the older version. I mean, this code

$('.tokenize-sample-demo1').on('tokenize:select', function(container){
    $(this).tokenize2().trigger('tokenize:search', [$(this).tokenize2().input.val()]);
});

Thanks.