diff options
author | Joshua Borton <digitaltoad@gmail.com> | 2016-11-15 14:23:26 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-11-15 14:23:26 -0500 |
commit | 0b296dd8c2aefefe89787be5cc627d44cf431150 (patch) | |
tree | 3e7770111c93e8dfbee55482115ff9ffe943d5c4 /webapp/components/new_channel_modal.jsx | |
parent | b7a063446b932922f8830c1a0590c8f1f2bca65b (diff) | |
download | chat-0b296dd8c2aefefe89787be5cc627d44cf431150.tar.gz chat-0b296dd8c2aefefe89787be5cc627d44cf431150.tar.bz2 chat-0b296dd8c2aefefe89787be5cc627d44cf431150.zip |
Add Add `onExit` hook to new_channel_modal (#4344)
This delays updating the url with the new channel until after the modal
is exited which bypasses a state where the center textarea is focused
and then focus is removed due to how react-overlays handles restoring
focus to the last element focused before the modal was shown.
Diffstat (limited to 'webapp/components/new_channel_modal.jsx')
-rw-r--r-- | webapp/components/new_channel_modal.jsx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/webapp/components/new_channel_modal.jsx b/webapp/components/new_channel_modal.jsx index 4122c3bfb..6ca8911c5 100644 --- a/webapp/components/new_channel_modal.jsx +++ b/webapp/components/new_channel_modal.jsx @@ -209,6 +209,7 @@ class NewChannelModal extends React.Component { show={this.props.show} bsSize='large' onHide={this.props.onModalDismissed} + onExited={this.props.onModalExited} > <Modal.Header closeButton={true}> <Modal.Title> @@ -382,6 +383,7 @@ NewChannelModal.propTypes = { serverError: React.PropTypes.node, onSubmitChannel: React.PropTypes.func.isRequired, onModalDismissed: React.PropTypes.func.isRequired, + onModalExited: React.PropTypes.func.optional, onTypeSwitched: React.PropTypes.func.isRequired, onChangeURLPressed: React.PropTypes.func.isRequired, onDataChanged: React.PropTypes.func.isRequired |