bootstrap-modal
bootstrap-modal copied to clipboard
is there any compatibility issues with select2.js?
when i used select2.js in bootstrap-modal,the modal fails to display options correctly.
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