react-modal-dialog icon indicating copy to clipboard operation
react-modal-dialog copied to clipboard

Disable body scroll when modal is open

Open onurhb opened this issue 8 years ago • 6 comments

This feature would be cool.

onurhb avatar May 06 '16 19:05 onurhb

What does this mean?

qimingweng avatar May 12 '16 17:05 qimingweng

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.

onurhb avatar May 12 '16 18:05 onurhb

@onurmhb Any suggestions on how to turn that off?

qimingweng avatar May 17 '16 19:05 qimingweng

@qimingweng the modal could add a class to the body with overflow-y: hidden

edrpls avatar Sep 16 '16 00:09 edrpls

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

vsubbotskyy avatar Oct 28 '16 08:10 vsubbotskyy

yep overflow hidden and height on body, but we dont' want to scroll top when modal is open, any solution?

IveSix avatar Nov 13 '17 09:11 IveSix