-
Notifications
You must be signed in to change notification settings - Fork 809
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
[added] Allow overlay override #319
Conversation
* Add sauce labs testing info to karma This also removes Node versions 4, 5, 6 from Travis. The node version only matters for development not for use. I don't think it's a problem officially supporting only the latest node for development. * Make specs work under IE 11
@cema-sp this looks awesome. i'll bring some feedback later. |
this PR allow a stack of modals to give back focus to parent modal.
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.
Awesome PR. It just need to squash all commits. I'll try to test more this feature.
Fixes issue #17: "When the modal is unmounted, it will abruptly close, not waiting for any animations to finish." The bug was caused by the Modal component unmounting the portal immediately in `componentWillUnmount` regardless of whether the portal is currently closing or would animate to close. Now when a Modal has a non-zero `closeTimeoutMS`, the Modal inspects the portal state before closing. If the portal is open or closing, but not closed, it waits to unmount the portal. If the portal is open and not already closing, the Modal calls closeWithTimeout() to trigger the close. Adds test to ensure portal DOM persists after Modal is unmounted when the Modal has a `closeTimeoutMS` set. Updates existing tests to properly unmount test Modal instances.
* Allow overlay override * Add overlay overriding info
@diasbruno Rebased & squashed |
}, | ||
|
||
openModal: function() { | ||
this.setState({modalIsOpen: true}); | ||
this.setState({ ...this.state, modalIsOpen: 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.
Is there some special reason for this? setState
actually does shallow merge automatically.
@diasbruno would this PR get merged at any point soon? Would love to have the scroll functionality on the modal. thanks. |
@Monte9 FYI if all you need is a scrollable modal, you can just add
to your css |
@rifkegribenes that's correct. the idea for this PR is to make the overlay customizable. @cema-sp I think it's a good time to 'revive' this branch. Any help you need to get this branch updated, please let me know. |
@rifkegribenes thanks for the quick css fix. I found the following works better for my case. It retains the modal positon. (I have the modal open a little closer to the top instead of center.)
|
Sorry, won't be able to get back to it any time soon. |
Continues and Closes #281
@diasbruno @claydiffrient Sorry that it took so long for me to prepare this feature. Leaving previous branch if someone uses it.
To override overlay one should provide
overlay
prop toModal
containing react element. That component will be cloned and filled with overlay props and children (usingReact.cloneElement
).Another way may be to provide
overlayComponent
andoverlayProps
and then create react element from them (usingReact.createElement
). Which way us better and more idiomatic?Changes proposed:
ModalOverlay
to componentModal.props.overlay
propAcceptance Checklist:
CONTRIBUTING.md
.