-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(Modal): Support fade and timeout props in the Modal component to allow configuring + disabling of the fade effect #339
feat(Modal): Support fade and timeout props in the Modal component to allow configuring + disabling of the fade effect #339
Conversation
631e922
to
4b85158
Compare
- if fade=false, the following happens: - no 'fade' class is applied - the modal + backdrop transition timeouts become 0 - the transitionAppear, etc. booleans passed to Fade are false
1785b5e
to
e75bb5c
Compare
- This feels like a better design. If we are not doing a fade effect, why use a Fade component? - This also gets rid of the usage of TransitionGroup when fade={false}. - Ensure onEnter and onExit fire when expected.
e75bb5c
to
4acf9b8
Compare
- Extract modalDialog rendering into a separate method - Simplify the variable setting in #renderChildren following the movement of several of them into #modalDialog
1595c79
to
6b9af07
Compare
src/Modal.js
Outdated
|
||
if (this.hasTransition()) { | ||
const modalTransitionTimeout = 300; | ||
const backdropTransitionTimeout = 150; |
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.
Should these times be configurable, or should that be another PR. At a certain point we could make the transition timing variable and when it is 0 disabled the transition animation.
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.
I thought that was a good idea. I added that in this commit: a2fb915
Let me know what you think. Thank you for taking a look!
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.
…e as props - Update docs - Add test
Could this be merged? I really need this. |
@annejohnson I unfortunately messed up by not merging this first. A different pr merge caused a conflict with this branch. Can you resolve the conflict and commit that change? Thanks and sorry about that! |
Conflicts: src/Modal.js
@eddywashere I resolved the conflict. Sorry for the delay. Thanks for taking a look at these updates! |
Can we merge this please? Seems like its solid. |
PR [DefinitelyTyped#339](reactstrap/reactstrap#339) adds a new prop for Modal component.
This PR adds support to the
Modal
component for afade
prop of type boolean (default value: true). It also adds support for modal+backdrop appear/enter/leave timeout props.It addresses the following issues: #168 & #352
If a value of false is passed for
fade
, the Bootstrap modal appears instantaneously, without a fade transition. Likewise when the modal closes.The timeout props control the speed of the fade effect for the modal and the backdrop.
Also included in this PR are test cases and an example in the documentation.