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

Added isBodyScrollable prop #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sushant-j
Copy link

This prop adds a no-scroll class on body when set to FALSE.

P.S. Used a quick hacky way, manipulating DOM directly from render function.
I realize this is probably not the ideal way to do this.
Would like if you could suggest an alternate, ideal way.

…n set to FALSE.

Used a quick hacky way, manipulating DOM directly from render function.
I realize this is probably not the ideal way to do this.
Would like if you could suggest an alternate, ideal way.
@egoist
Copy link
Owner

egoist commented Oct 11, 2017

Should update ./themes/default.css as well

@egoist
Copy link
Owner

egoist commented Oct 11, 2017

hmm I guess this won't work since .no-scroll on body won't be removed when this component is destroyed? we need to turn this component into non-functional component and use lifecycle hooks.

@sushant-j
Copy link
Author

I ran it locally and it works.
When I close the modal (click-outside), the .no-scroll class is removed from the body.

Is there some other case I am missing here?

Also, the tests on circleci are failing, due to document being undefined. How can we pass this test?

@egoist
Copy link
Owner

egoist commented Oct 11, 2017

When I close the modal (click-outside), the .no-scroll class is removed from the body. Is there some other case I am missing here?

when the component is destroyed.

you closed the modal but the component is still alive.

@sushant-j
Copy link
Author

when the component is destroyed.

In what scenario would it be destroyed rather than just changed?

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

Successfully merging this pull request may close these issues.

None yet

2 participants