Select2 open dropdown on focus

前端 未结 16 2219
陌清茗
陌清茗 2020-12-05 00:21

I have a form with multiple text inputs and some select2 elements. Using the keyboard to tab between fields works fine - the Select2 element behaves like a form element and

16条回答
  •  Happy的楠姐
    2020-12-05 00:37

    an important thing is to keep the multiselect open all the time. The simplest way is to fire open event on 'conditions' in your code:

    
    

    javascript:

    $(".select2-select").select2({closeOnSelect:false});
    $("#myList").select2("open");
    

    fiddle: http://jsfiddle.net/xpvt214o/153442/

提交回复
热议问题