Open the drop down list permanently of select2

前端 未结 2 1265
长情又很酷
长情又很酷 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

    0 讨论(0)
  • 2021-02-18 23:13

    From the select2 documentation, here:

        $("#select").select2({
                closeOnSelect: false
        });
    
    0 讨论(0)
提交回复
热议问题