搜索框不允许在select2-search div中输入

时间:2015-06-19 07:50:53

标签: javascript html css

我有这样的HTML代码:

<span class="select2-container select2-container--default select2-container--open" style="position: absolute; top: 139px; width: 314px; left: 579.5px;">
    <span class="select2-dropdown select2-dropdown--below" dir="ltr">
        <span class="select2-search select2-search--dropdown">
            <input class="select2-search__field" type="search" tabindex="0" role="textbox">
        </span>
        <span class="select2-results">
            <ul class="select2-results__options" role="tree" id="select2-teamid-results" aria-expanded="true" aria-hidden="false">
                <li class="select2-results__option" id="select2-teamid-result-3jny-2" role="treeitem" aria-selected="false">aaa</li>
                <li class="select2-results__option select2-results__option--highlighted" id="select2-teamid-result-coe9-5" role="treeitem" aria-selected="false">bbb</li>
            </ul>
        </span>
    </span>
</span>

,这是下拉列表的下拉部分。当下拉列表(不包括下拉部分)位于panel-body类div中时,搜索框允许输入。当下拉列表位于模态体类div内时,搜索框不允许输入。搜索框代码为<input class="select2-search__field" type="search" tabindex="0" role="textbox">

我尝试将输入框的'readonly'属性设置为false,但它不起作用。

相关的js文件是'select2.min.js'。

0 个答案:

没有答案