bootstrap-modal icon indicating copy to clipboard operation
bootstrap-modal copied to clipboard

is there any compatibility issues with select2.js?

Open Misakic opened this issue 10 years ago • 1 comments

when i used select2.js in bootstrap-modal,the modal fails to display options correctly.

Misakic avatar Sep 15 '15 05:09 Misakic

I have the same problem, is a problem related with z-index property on select2 plugin, what I do for temporary fix this problem is assign a z-index property on initialization.

//global javascript
var zIndexSelect2 = 1050;
//local javascript
zIndexSelect2 = zIndexSelect2 + 10;

var options = {
    dropdownCss: {
        'z-index': zIndexSelect2
    }
    //other options...
}

//inicialize
$('select').select2(options)

so every time you use select2 within a modal you must set zIndexSelect2 + 10 an then set the options otherwise modal will be on top select2.

Is a temporary fix but at least it works for me

joelmora avatar Sep 16 '15 13:09 joelmora