react-modal-dialog
react-modal-dialog copied to clipboard
Disable body scroll when modal is open
This feature would be cool.
What does this mean?
When the modal is active. The user is still able to scroll the page. Try scrolling, you'll see the page scroll behind the modal.
@onurmhb Any suggestions on how to turn that off?
@qimingweng the modal could add a class to the body with overflow-y: hidden
I suggest to toggle css class on body when modal is being opened or closed. We can than use @edrpls solution in our own code. I created a PR: https://github.com/qimingweng/react-modal-dialog/pull/36
yep overflow hidden and height on body, but we dont' want to scroll top when modal is open, any solution?