Search code examples
reactjsmodal-dialogoverflow

How to remove overflow: hidden placed by bootstrap 5 modal?


I am using bootstrap 5 for a react application. My problem is, every second time when I am opening a modal, there following style is placed on the body element: style="overflow: hidden; padding-right: 17px;" and also the class modal-open, which is preventing me to scroll outside the modal even after I am closing it. Is there any possibility to avoid this issue?


Solution

  • You can manipulate every bootstrap class in you scc or scss file. Just call that class and remove style that you do not want. In your case you can set

    .modal{
       overflow: auto !important;
    }