Skip to content
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

Merged
merged 9 commits into from
May 14, 2017

Conversation

annejohnson
Copy link
Contributor

@annejohnson annejohnson commented Feb 24, 2017

This PR adds support to the Modal component for a fade 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.

- 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
@annejohnson annejohnson force-pushed the add-modal-fade-prop branch 2 times, most recently from 1785b5e to e75bb5c Compare February 26, 2017 18:54
- 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.
- Extract modalDialog rendering into a separate method
- Simplify the variable setting in #renderChildren
  following the movement of several of them into
  #modalDialog
@annejohnson annejohnson changed the title Support a fade=false prop in the Modal component to disable the fade transition feat(Modal) Support a fade=false prop in the Modal component to disable the fade transition Feb 27, 2017
@annejohnson annejohnson changed the title feat(Modal) Support a fade=false prop in the Modal component to disable the fade transition feat(Modal): Support a fade=false prop in the Modal component to disable the fade transition Feb 27, 2017
src/Modal.js Outdated

if (this.hasTransition()) {
const modalTransitionTimeout = 300;
const backdropTransitionTimeout = 150;
Copy link
Member

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.

Copy link
Contributor Author

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!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've pushed another commit after seeing issue #352. That person wants the ability to separately configure appear vs. enter vs. leave timeouts.

It's a lot of new props, but all optional ones. What do you think?
ab93b7d

@annejohnson annejohnson changed the title feat(Modal): Support a fade=false prop in the Modal component to disable the fade transition feat(Modal): Support fade and timeout props in the Modal component to allow configuring + disabling of the fade effect Mar 4, 2017
@theduke
Copy link

theduke commented Mar 29, 2017

Could this be merged?

I really need this.

@eddywashere
Copy link
Member

@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!

@annejohnson
Copy link
Contributor Author

@eddywashere I resolved the conflict. Sorry for the delay. Thanks for taking a look at these updates!

@vstlouis
Copy link

Can we merge this please? Seems like its solid.

@eddywashere eddywashere merged commit babee0f into reactstrap:master May 14, 2017
Dohxis added a commit to Dohxis/DefinitelyTyped that referenced this pull request Aug 24, 2017
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.

None yet

5 participants