ng2-bootstrap-modal icon indicating copy to clipboard operation
ng2-bootstrap-modal copied to clipboard

Overflow auto?

Open oixan opened this issue 7 years ago • 3 comments

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

oixan avatar May 16 '17 17:05 oixan

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

ravipatel2293 avatar May 17 '17 14:05 ravipatel2293

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 :)

oixan avatar May 18 '17 20:05 oixan

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

pikachumetal avatar May 22 '17 10:05 pikachumetal