Reputation: 7724
This question is related to this:-
Why does a second vertical scroll bar appear in this Bootstrap 3.0 Modal demo?
Ok. I've override the .modal
class overflow-y
rule:-
.modal {
overflow-y: auto !important;
}
But now when the modal opens I do not see scroll bar. That's fine. That is what I required. However, it still consumes the space, and the page moves towards the left whenever the modal opens.
screenshot:-
Any solution?
Upvotes: 3
Views: 2645
Reputation: 3014
It's happening because of after open modal, modal is adding class "modal-open" to body tag.
to resolve this
You can override CSS as below
body.modal-open {
overflow-y: auto;
}
but still you will see another disable scroll bar at side. to resolve that
you can override as below
.modal{
overflow-y: auto;
}
Upvotes: 0
Reputation: 7781
Instead of auto give hidden.
.modal {
overflow-y: hidden;
}
It worked for me.
Upvotes: 0
Reputation: 7724
Culprit caught. Bootstrap adds a class to the body and other areas with the following name and rule:-
body.modal-open, .modal-open .navbar-fixed-top, .modal-open .navbar-fixed-bottom {
margin-right:15px;
}
also override this class as follows, and it'll be fine.
body.modal-open, .modal-open .navbar-fixed-top, .modal-open .navbar-fixed-bottom {
margin-right:0px;
}
Upvotes: 5