Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overflow-y hidden to the body #34

Closed
mwmcode opened this issue Jul 18, 2017 · 4 comments
Closed

overflow-y hidden to the body #34

mwmcode opened this issue Jul 18, 2017 · 4 comments

Comments

@mwmcode
Copy link

mwmcode commented Jul 18, 2017

Hi,

Thanks for the awesome library!

I'm trying to implement the gird gallery so that when I click on a button, the lightbox will be displayed immediately isOpen={true}

I noticed the lightbox adds css rule: overflow-y:hidden to the body tag, which is fine except it's not removing that css rule when I close the lightbox (press esc) causing the page to freeze (no scroll)!

Any ideas/suggestions on how to workaround this?

@benhowell
Copy link
Owner

benhowell commented Jul 18, 2017

Hi,
This is a bug in upstream package https://github.com/jossmac/react-images
This is the issue in question: jossmac/react-images#146

I will push an update when this is fixed upstream.

@mwmcode
Copy link
Author

mwmcode commented Jul 18, 2017

Thanks for your timely response.

If anyone else having the same issue, my current workaround is reseting those rules by adding the below line to the lightboxWillClose life-cycle method

Object.assign(document.body.style, {paddingRight: 0, overflowY: 'auto'}) 

Check your original body tag css rules (padding-right & overflow-y) and reset to those.

@benhowell
Copy link
Owner

Thanks for the workaround example... hopefully it'll be of use to others.
I'll leave this issue open until things are fixed upstream 👍

@benhowell
Copy link
Owner

jossmac/react-images#146 closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants