我正在使用select2多值选择框,除了一个小问题之外,它工作得非常好:当我点击“x”删除已经选中的内容时,会弹出下拉菜单。选择已成功删除,但我希望在删除内容时不显示下拉列表。
这是一段html输出:
<span class="select2 select2-container select2-container--default select2-container--below" dir="ltr" style="width: 100%;">
<span class="selection">
<span class="select2-selection select2-selection--multiple" tabindex="0" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false" aria-owns="select2-location-results">
<ul class="select2-selection__rendered">
<li class="select2-selection__choice">
<span class="select2-selection__choice__remove" role="presentation">×</span>
1
</li>
<li class="select2-selection__choice">
<span class="select2-selection__choice__remove" role="presentation">×</span>
2
</li>
<li class="select2-search select2-search--inline">
<input class="select2-search__field" type="search" tabindex="-1" role="textbox" placeholder="" style="width: 0.75em;">
</li>
</ul>
</span>
</span>
<span class="dropdown-wrapper" aria-hidden="true"></span>
</span>
我能找到的唯一相关信息是this github issue,但据说已经修复了。