Open the drop down list permanently of select2

前端 未结 2 1267
长情又很酷
长情又很酷 2021-02-18 22:21

I\'m using select2 for multiple value selection. I need to display the drop down list permanently.

Right now when we select or click the input box of select2, the drop d

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-18 22:48

    Try this:

    var list = $("#select").select2({
        closeOnSelect: false
    }).on("select2:closing", function(e) {
        e.preventDefault();
    }).on("select2:closed", function(e) {
        list.select2("open");
    });
    

    For Ref Click here

提交回复
热议问题