ng2-bootstrap-modal
ng2-bootstrap-modal copied to clipboard
Overflow auto?
There is a way to enable overflow auto for the modal and disable body overflow auto?
I have the same question.Is there any solution for this?
i resolved this in a rude manner, but it work!
- In dialog.service.ts in the addDialog method just before the return add:
var body = document.getElementsByTagName("body")[0]; body.style.overflow = "hidden"; - in the removeDialog method as first line add var body = document.getElementsByTagName("body")[0]; body.style.overflow = "";
- in a custom css file add .modal { overflow: auto; }
Try this, I hope it can work for you too.
Bad englado ... sorry :)
I think is a better solution to add the class "modal-open" to the body, wich is a bootstrap class and do the work.