I'm using ngx-bootstrap modals in a project that displays enough on the page the content scrolls vertically. Whenever a modal is opened the document body scrolls to the top instead of leaving the position alone, which is the expected behavior.
I can manually set overflow: auto
on the body in the dev console to resolve this behavior. That is, once set, opening modals no longer scrolls to the top of the document body. However, adding this css to my component did not apply to the body. Changing the bootstrap css files in the node_modules folder also did not work. Bootstrap continues to set overflow: hidden
and my component css file does not apply body { overflow: auto !important; }
though it does successfully apply the other defined styles.
Any suggestions?