chosen-ajax-addition
chosen-ajax-addition copied to clipboard
focus and events implement
:neckbeard:Hi!
Would be great to be able to observe the events of the element and implement the 'focus' event something like:
$('#states-select').ajaxChosen({
//params
});
//more code..
$('#states-select').focus();
or maybe like the modal of twBootstrap:
$('#states-select').ajaxChosen({
//params
});
//more code..
$('#states-select').ajaxChosen('focus');
i don't know :confused: is a simple idea, what is your opinion?
For me it looks like feature of Chosen plugin not ajaxChosen extension. What do you think @ksykulev ?
I would probably put that feature on the chosen plugin as well. But in the mean time if you need to programmatically focus on the input box and have chosen open you can do something like this:
chosen = $('#some-select').ajaxChosen({..}).next();
chosen.trigger('click'); //use this to open/focus on chosen.
I do this in the specs if you need a better example.