The above occurs when you use a modal inside another modal. When I open a modal inside another modal, the closing of the latter removes the class modal-open
from the body
. The fix of the issue depends on how you close the latter modal.
If you close the modal with html like,
<button type="button" class="btn" data-dismiss="modal">Close</button>
Then you have to add a listener like this,
$(modalSelector).on("hidden.bs.modal", function (event) {
event.stopPropagation();
$("body").addClass("modal-open");
return false;
});
If you close the modal using javascript like,
$(modalSelector).modal("hide");
Then you have to run the command some time after like this,
setInterval(function(){$("body").addClass("modal-open");}, 300);