When you open a modal from a link in another modal, it close the first modal to switch to the new one, but the body lose his "modal-open" class in the process.
Multiple modals are currently not supported.
Yes I know, it's not the point. The issue is about the body class modal-open.
Duplicate of #17956.
Anyone looking to solve this, it's stupidly easy. Not sure why they're not implementing something similar to this. I think I'll submit a pull request for this if I can.
//Watch for closing modals
$('.modal').on('hidden.bs.modal', function () {
//If there are any visible
if($(".modal:visible").length > 0) {
//Slap the class on it (wait a moment for things to settle)
setTimeout(function() {
$('body').addClass('modal-open');
},200)
}
});
@Fusty it's no a coplete solution. In my web app i keep permanently a padding on right of body after close the second modal.
Try putting the second modal outside the first modal.
@Fusty Thankyou very much!!
A detailed blog with an example: http://wp.me/p3Osmq-uf
Most helpful comment
Anyone looking to solve this, it's stupidly easy. Not sure why they're not implementing something similar to this. I think I'll submit a pull request for this if I can.