ankosoftware / ng2-bootstrap-modal

Library to simplify the work with bootstrap modal dialogs
MIT License
54 stars 63 forks source link

Overflow auto? #25

Open oixan opened 7 years ago

oixan commented 7 years ago

There is a way to enable overflow auto for the modal and disable body overflow auto?

ravipatel2293 commented 7 years ago

I have the same question.Is there any solution for this?

oixan commented 7 years ago

i resolved this in a rude manner, but it work! 1) In dialog.service.ts in the addDialog method just before the return add:
var body = document.getElementsByTagName("body")[0]; body.style.overflow = "hidden"; 2) in the removeDialog method as first line add var body = document.getElementsByTagName("body")[0]; body.style.overflow = ""; 3) in a custom css file add .modal { overflow: auto; }

Try this, I hope it can work for you too.

Bad englado ... sorry :)

pikachumetal commented 7 years ago

I think is a better solution to add the class "modal-open" to the body, wich is a bootstrap class and do the work.