Reputation: 45
I created a modal and inside the modal I created a button to open the second modal and close the first but the problem is that the scrollbar doesn't work for the second modal but works for page.
How could I fix this?
code in fiddle:
Upvotes: 0
Views: 320
Reputation: 9259
In this case, you shouldn't use data-toggle="modal"
or data-dismiss="modal"
(as there's no guarantee that the hiding and the showing will happen in the right order) and instead do the showing and hiding yourself. Example:
<button type="button" id="modal-2-btn">open modal 2 »</button>
$('#modal-2-btn').on('click', function () {
$('#modal-trainertype').one('hidden.bs.modal', function () {
$('#modal-food').modal('show');
}).modal('hide');
});
Upvotes: 1