带有select2 z-index的bootstrap模态

问题描述 投票:1回答:3

我正在尝试将来自不同html页面的内容加载到弹出窗口,然后在其上应用select2。

一切正常,但是select2的z-index不正确,如果我把它修改为比bootstrap对话框更大的值,则为event。

enter image description here

这是我正在做的事情的片段

.select2-dropdown {  
  z-index: 10060 !important;/*1051;*/
}

有任何想法吗 ?

bootstrap-modal jquery-select2-4
3个回答
7
投票

结合在Select2 GitHub问题跟踪器上找到的几个解决方案似乎让Select2 v4与Bootstrap模式一起工作。

添加此CSS ...

.select2-container--open {
    z-index: 9999999
}

然后我仍然无法输入搜索框...从模态div中删除“tabindex”属性修复了该问题。


0
投票

我有同样的问题,但我确实使用了这个解决方案

style =“z-index:50!important;”直接在模态上

<div id="mdl_name_id" class="modal " tabindex="-1"  style="z-index: 50 !important;" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">

0
投票

我希望它的工作

尝试从模态中删除tabindex="-1"

© www.soinside.com 2019 - 2024. All rights reserved.