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
[changed] Don't render div on dom when isOpen is false #205
Conversation
@claydiffrient any thoughts? looks good. |
@CompuIves Sorry for the delay on this. Could you change the commit message from [fixed] to [changed] ? I think that will make it easier to indicate that it's more of a breaking change vs. a simple bug fix. I believe this is a valuable change. I'd like to get it in for v2. |
No problem! I changed it. |
Hi @CompuIves, we have released |
Okay! Will do it today. |
There were a lot of changes, I decided to just recreate the changes based on new I wasn't able to reproduce the rendering of |
Awesome, @CompuIves! |
Ah, that works, thanks! Added test. |
yeah, that is correct. |
You can squash the commits and append |
Done! |
I noticed that when I wanted to animate the fadein of a modal it only worked for the first time. This was because the css animation of
ReactModal__Overlay--after-open
only works when a div is rendered for the first time. That's why I changed the logic to render nothing if there is no modal.I'm aware that this can break a lot of things (like using a ref for
ReactModal
) for other people, so maybe we need to bump a major version if we want to have this.Changes proposed:
null
instead ofdiv
Upgrade Path (for changed or removed APIs):
When you want to use a
ref
onReactModal
and use it after it's rendered, you will have to place the call to theref
in asetTimeout
so it's accessible after it's rendered.Acceptance Checklist:
CONTRIBUTING.md
.This allows users to add an animation for opening the modal.