Opening AngularJS modal causes page to shift if scrollbar exists

人走茶凉 提交于 2019-12-05 12:20:56

As a patch over the bug, I simply put in a vertical scrollbar on the body. This forces one to appear, even if the page requires no scrolling. I would love a better solution though.

body{
overflow-y: scroll !important;

}

This is an existing bug with bootstrap-modal which is what I assume you're using. There's potential fixes given in this thread

e.g, adding this css, perhaps try putting it in a tag at the top of the page to see if it works before you modify your files

.modal-open, .modal-open .navbar-fixed-top {
    margin-right: auto !important;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!