Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Show dropdown already on focus event #75

Closed
shm-sl opened this issue Mar 13, 2020 · 2 comments
Closed

Show dropdown already on focus event #75

shm-sl opened this issue Mar 13, 2020 · 2 comments
Labels

Comments

@shm-sl
Copy link

shm-sl commented Mar 13, 2020

Is it possible to show the dropdown as soon as the user clicks into the form field?

@dragonofmercy
Copy link
Owner

Hi !
You can do like this:

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

@p0m1d0rka
Copy link

Ty for this question and answer.
Maybe move it to documentation?
btw modify you code, cause select event doesnt trigger again after you select item and click on input field.

        $('.tokenize-demo + .tokenize .token-search input').on('click', function(container){
          console.log("click")
          $('.tokenize-demo').tokenize2().trigger('tokenize:search', [$('.tokenize-demo').tokenize2().input.val()]);
        });  

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants