Reputation: 105
When I open modal in Bootstrap 3.3.7 it jumps to top of page.
I am using Bootstrap JS 3.3.7 from official CDN
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js
I have already tried with CSS solutions like this, but doesn´t works for me
body.modal-open {
overflow: visible;
}
Here is URL of my webapp in production to can see the behavior of Boostrap modal. My webapp with modal issue
Upvotes: 1
Views: 7033
Reputation: 1583
If you are trying to remove the scroll from modal. This could be your solution.
Few things you can do about your modal
modal-lg
class to your modal-dialog <div>
eg : <div class="modal-dialog modal-lg" role="document">
Added a screenshot at last, on how it will look after doing all above changes.
Bootstrap model : https://getbootstrap.com/docs/3.3/javascript/#modals
//Changing the margin of dialog
.modal-dialog {
margin: 5px auto;
}
//removing extra padding from the body
.modal-body {
position: relative;
padding: 0 15px;
}
// Add padding to your footer
.modal .modal-footer {
border-top: none;
padding: 10px;
}
// change height of textarea
textarea.form-control {
height: 100px !important;
}
Upvotes: 3