Select2选择一个选项后缩小它的宽度

时间:2018-01-20 09:54:14

标签: jquery jquery-select2

我正在使用select2 jquery,它在chrome,opera和mozilla firefox中运行良好。

但不是在Internet Explorer中,我使用的是IE 11版

选择选项后,选择框缩小为0.95px

以下是select2最初

创建的范围
{"0":10,"1":3,"2":97,"3":98,"4":99,"5":18,"6":5,"7":97,"8":100,"9":109,"10":105,"11":110,"12":26,"13":8,"14":112,"15":97,"16":115,"17":115,"18":119,"19":111,"20":114,"21":100}

在构造函数中设置宽度如下

<span class="select2 select2-container select2-container--default" style="width:479px;" dir="ltr" data-select2-id="1">some html</span>

宽度设置为100%,如下所示

    $("body").find(".js-example-basic-multiple").select2( 
        {
            placeholder: "select one",
            allowClear: true,
            width: '100%',
       }
    );

但是从选择框中选择一个选项后,框宽会缩小到0.95像素,如下所示,这只发生在ie

<span class="select2 select2-container select2-container--default" style="width: 100%;" dir="ltr" data-select2-id="1">some html</span>

0 个答案:

没有答案