gfranko / jquery.selectBoxIt.js

A jQuery Select Box Plugin for Mobile, Tablet, and Desktop
http://www.selectboxit.com
MIT License
852 stars 301 forks source link

Use the "changed" event to unfocuse the dropdown. #295

Open rprsnt opened 10 years ago

rprsnt commented 10 years ago

Hi,

In a classic dropdown, you can blur the dropdown after the choose (like that : http://jsfiddle.net/9TG8r/) But with selectboxit, the dropdown always becomes focused at the the end of the choose. Is there a way to unfocused it automatically ?

I have tried to use the "changed" event, but it doesn't work. I cant find find where is my mistake ! I have exactly the same code as you :

$("select").selectBoxIt({
        hideCurrent: true,
        showEffect: "slideDown",
        showEffectSpeed: 100,
    });

    var selectBox = $("select").selectBoxIt();

    // After the select box has been changed
selectBox.on('changed', function(ev, obj) {
  // obj.dropdown corresponds to the selectboxit dropdown
  obj.dropdown.blur();
});

Thanks

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.