Skip to content

[fixed] Remove ReactModal__Body--open class when unmounting Modal #94

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

Merged
merged 1 commit into from
Mar 28, 2016

Conversation

jasonblanchard
Copy link
Contributor

This fixes a bug where if a modal was unmounted without closing first, the ReactModal__Body--open stays on the body element.

This causes issues when, for example, you have a react-router link in a modal that takes you directly to another route handler component. The expected behavior for this is the modal closes and all page state related to the modal having been open is reset.

@mattwoodco
Copy link

We're experiencing the same issue.

@ypt
Copy link

ypt commented Nov 4, 2015

👍 Same here.

@salcman
Copy link

salcman commented Nov 4, 2015

+1

@minipai
Copy link

minipai commented Nov 7, 2015

+1 need this

@mattwoodco
Copy link

@mzabriskie, hello from a former Provonian!

Any word on this?

@mikecx
Copy link

mikecx commented Jan 22, 2016

+1, had to copy the functionality into my own close function because the one in the code itself doesn't work.

@davey-h
Copy link

davey-h commented Jan 25, 2016

+1, had to build a workaround until this is ready

@jasonblanchard
Copy link
Contributor Author

Any updates on this? Seems like a significant bug.

@@ -136,6 +136,13 @@ describe('Modal', function () {
unmountModal();
});

it('removes class from body when unmounted without closing', function() {
modal = renderModal({isOpen: true});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need a var here to prevent this from being an implicit global.

@claydiffrient
Copy link
Contributor

@jasonblanchard You'll need to resolve some conflicts, but also there is one little note I added to the spec on your commit. Fix that up and resolve any conflicts, and I'm happy to merge and include in the next release.

@jasonblanchard jasonblanchard force-pushed the remove-body-class-unmount branch from 12ecf65 to cb53bca Compare March 28, 2016 13:40
@jasonblanchard
Copy link
Contributor Author

@claydiffrient I've rebased off master, addressed your line note and verified that the fix still works and that all tests are passing.

@claydiffrient claydiffrient merged commit f9871c6 into reactjs:master Mar 28, 2016
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.

8 participants