I want to give the users the ability to change from an input to another using the tab key. However on select2 the tab key is not working. How can I open select2 on focus?
I tried this solution but it's not working.
$('.js-select').select2({
placeholder: "Select",
width: "100%"
}).one('select2-focus', select2Focus).on("select2-blur", function () {
$(this).one('select2-focus', select2Focus)
})
function select2Focus() {
var select2 = $(this).data('select2');
setTimeout(function() {
if (!select2.opened()) {
select2.open();
}
}, 0);
}