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
modal-open class is not being added to body in some cases #1279
Comments
I ran into this same issue. I was conditionally rendering the I ended up just waiting to unmount the component until the next update cycle. If this is considered a bug, then it's probably best to use something other than the state to track whether or not the modal needs to be destroyed so you don't have to worry about any state race conditions. |
Is there fix to this issue? I'm having the same problem. |
There's a hacky solution. You need to wait until a modal is closed and only then unmount it Fixed example: https://stackblitz.com/edit/reactstrap-jynqel?file=Example.js |
Though if you have only one opened modal, it should work ok I think (#1368) |
I think the latter issue here is the This could be why there are no other reported cases of this. Furthermore, I was checking out the stackblitz link and it looks to me like the |
Modal
#6.5.0
umd/csj/es
#16.4.1
#4.1.3
What is happening?
Modal.destroy might be called twice on close + unmount, so
Modal.openCount
is becoming negative andmodal-open
is not being added to bodyWhat should be happening?
Modal.destroy should not be called twice on close + unmount
Steps to reproduce issue
modal-open
is added to bodymodal-open
is not added to bodyThe text was updated successfully, but these errors were encountered: