diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-11-04 11:21:14 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-11-04 11:21:14 -0400 |
commit | e6f7a47c99075a39d862308659b904bfaf64a11a (patch) | |
tree | 863f6eb80a2367fb080437d9e037fca283e3c270 /webapp/components/delete_channel_modal.jsx | |
parent | dbdd719c51d061dfc327644d4b2ca89a0595b4f1 (diff) | |
download | chat-e6f7a47c99075a39d862308659b904bfaf64a11a.tar.gz chat-e6f7a47c99075a39d862308659b904bfaf64a11a.tar.bz2 chat-e6f7a47c99075a39d862308659b904bfaf64a11a.zip |
PLT-4507 Don't mount modals until opened to make resetting state automatic (#4358)
* Don't mount modals until opened to make resetting state automatic
* Move dimiss handler to be fired after modal exit animation complete
Diffstat (limited to 'webapp/components/delete_channel_modal.jsx')
-rw-r--r-- | webapp/components/delete_channel_modal.jsx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/webapp/components/delete_channel_modal.jsx b/webapp/components/delete_channel_modal.jsx index 7ad213395..1b642861a 100644 --- a/webapp/components/delete_channel_modal.jsx +++ b/webapp/components/delete_channel_modal.jsx @@ -20,6 +20,9 @@ export default class DeleteChannelModal extends React.Component { super(props); this.handleDelete = this.handleDelete.bind(this); + this.onHide = this.onHide.bind(this); + + this.state = {show: true}; } handleDelete() { @@ -39,6 +42,10 @@ export default class DeleteChannelModal extends React.Component { ); } + onHide() { + this.setState({show: false}); + } + render() { let channelTerm = ( <FormattedMessage @@ -57,8 +64,9 @@ export default class DeleteChannelModal extends React.Component { return ( <Modal - show={this.props.show} - onHide={this.props.onHide} + show={this.state.show} + onHide={this.onHide} + onExited={this.props.onHide} > <Modal.Header closeButton={true}> <h4 className='modal-title'> @@ -84,7 +92,7 @@ export default class DeleteChannelModal extends React.Component { <button type='button' className='btn btn-default' - onClick={this.props.onHide} + onClick={this.onHide} > <FormattedMessage id='delete_channel.cancel' @@ -109,7 +117,6 @@ export default class DeleteChannelModal extends React.Component { } DeleteChannelModal.propTypes = { - show: React.PropTypes.bool.isRequired, onHide: React.PropTypes.func.isRequired, channel: React.PropTypes.object.isRequired }; |