React-modal: Is there a way to enable scrolling behind the modal?

Created on 17 Apr 2017  路  4Comments  路  Source: reactjs/react-modal

Summary:

I know it goes a lot against the nature of what a modal is suppose to do, but is there a way to make it so that when my mouse is hovering on the overlay, I am able the scroll the content behind it using the mousewheel?

As with most setups, I have two different React root components, one for all non-modal content, and one for contents within the modal itself. They are siblings within the body.

help wanted

Most helpful comment

@vorpus One option is to use a custom class for your specific modal. See reactjs/react-modal#using-css-classes.

All 4 comments

Hello,
By default its enable scrolling, but if you add this css it could block scroll.

.ReactModal__Body--open {
overflow: hidden;
}

So, just remove this css if you have such one.

@petertdinh Is @SergeyShvager suggestion solves you problem? If so, you can close this issue.
@SergeyShvager Thank you!

@diasbruno @SergeyShvager Is there a way to allow scrolling only when certain modals are open, but keep overflow:hidden for others?

@vorpus One option is to use a custom class for your specific modal. See reactjs/react-modal#using-css-classes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

phaedryx picture phaedryx  路  4Comments

istok20 picture istok20  路  3Comments

fabien-somnier picture fabien-somnier  路  3Comments

CXJoyce picture CXJoyce  路  4Comments

bjbrewster picture bjbrewster  路  4Comments