From 0b296dd8c2aefefe89787be5cc627d44cf431150 Mon Sep 17 00:00:00 2001 From: Joshua Borton Date: Tue, 15 Nov 2016 14:23:26 -0500 Subject: 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. --- webapp/components/new_channel_modal.jsx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'webapp/components/new_channel_modal.jsx') 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} > @@ -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 -- cgit v1.2.3-1-g7c22