https://jsfiddle.net/e6x4hq9h/
Open the first modal. It opens fine. Removes the background scrollbar.
Open the modal from within that modal. It causes the scroll to go to the background.
I searched for other solutions and none of them seem to fix this. I tried everything on this page: Bootstrap modal: close current, open new among others.
Javascript:
// Only one of these modals should show at a time.
$('#myModal2').on('show.bs.modal', function (e) {
$('#myModal').modal('hide');
})
.on('hide.bs.modal', function (e) {
$('#myModal').modal('show');
});
Update: The first and second modal must also allow scrolling as can be seen in this fiddle: https://jsfiddle.net/e6x4hq9h/21/