-
Notifications
You must be signed in to change notification settings - Fork 813
[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
[fixed] Remove ReactModal__Body--open class when unmounting Modal #94
Conversation
We're experiencing the same issue. |
👍 Same here. |
+1 |
+1 need this |
@mzabriskie, hello from a former Provonian! Any word on this? |
+1, had to copy the functionality into my own close function because the one in the code itself doesn't work. |
+1, had to build a workaround until this is ready |
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}); |
There was a problem hiding this comment.
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.
@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. |
12ecf65
to
cb53bca
Compare
@claydiffrient I've rebased off master, addressed your line note and verified that the fix still works and that all tests are passing. |
This fixes a bug where if a modal was unmounted without closing first, the
ReactModal__Body--open
stays on thebody
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.