I have a form with one text input and one select2 element (Version 4.0.0). I want when focus on text input, the select2 open.
Here’s what I’ve tried :
<select list="userAccountsMap.values" listKey="accountNo" listValue="accountNo"/>
<input id="destinationAccount" type="text" name="destinationAccount">
<script type="text/javascript">
('select').each(function( index ) {
$(this).select2();
}
});
$("#destinationAccount").focus(function () {
$("select").trigger('select2:open');
});
</script>
But it is not work. I don't understand what my problem is.
Select2 4.0.0 does not trigger the `focus` event, and as a result is not possible to automatically open the dropdown when the input is focused.
We are tracking the progress of standard events at https://github.com/select2/select2/issues/1908.
--
You received this message because you are subscribed to the Google Groups "select2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
To post to this group, send email to sel...@googlegroups.com.
Visit this group at http://groups.google.com/group/select2.
For more options, visit https://groups.google.com/d/optout.