gyarza
gyarza

Reputation: 3

Add select2 4.0.0 focus

In the new version of Select2 4.0 the focus event has been removed. how can I put it into practice or how can I make it work? Since I have been trying to do it myself.

Upvotes: 0

Views: 703

Answers (2)

pdobb
pdobb

Reputation: 18037

If you're trying to give focus to a select2-ized drop-down then I've found this to be the only thing that works in v4:

$('#my-select2-ized-drop-down').select2('open').select2('close');

Upvotes: 0

Emiliano Correa
Emiliano Correa

Reputation: 16

I have found the solution to your problem! I have modified the file Select2.js by adding the focus event, yet i have done so by naming the event "focus2". here there is a piece of code that may help you: $(your select).select2("focus2"); You can also use the following link: https://drive.google.com/open?id=0B2ESV1Ec1mMTfkNrOVptTUlBbXdnNkJKckNiQUZ3RmJ6UjdncFRwNUR5ZEJzQm40aXM4c2M&authuser=0

Regards!

Upvotes: 0

Related Questions