Home » Javascript » Hiding and showing bootstrap 4 modal at the same time will hide the browser's scrollbar

Hiding and showing bootstrap 4 modal at the same time will hide the browser's scrollbar

Posted by: admin August 19, 2018 Leave a comment

Questions:

I’m using Bootstrap 4.0 modal to display contents. The first modal is kinda long but it displays the browser’s scrollbar. And inside the modal , I have another button to call 2nd modal and it will hide the first modal. And when I close the 2nd modal, it will go back to the first modal but, then the browser’s horizontal scrollbar disappears after 0.5 seconds. Now, I cannot scroll top or bottom of the modal because the scrollbar has disappeared. Is there a way for me to prevent from the scrollbar from being removed?

Answers: