diff options
author | Asaad Mahmood <Unknowngi@live.com> | 2015-11-04 20:07:58 +0500 |
---|---|---|
committer | Asaad Mahmood <Unknowngi@live.com> | 2015-11-04 22:37:26 +0500 |
commit | 71035bfdc796093a2904747a67468249c4ba6edf (patch) | |
tree | 04be3f1886594c904bcd0f5a4f29aa8e0a49349e /web/react/components/rename_channel_modal.jsx | |
parent | 2840c317e5a88264aa044261558dda6d91ee1ff3 (diff) | |
download | chat-71035bfdc796093a2904747a67468249c4ba6edf.tar.gz chat-71035bfdc796093a2904747a67468249c4ba6edf.tar.bz2 chat-71035bfdc796093a2904747a67468249c4ba6edf.zip |
Adding focus for channel modals
Diffstat (limited to 'web/react/components/rename_channel_modal.jsx')
-rw-r--r-- | web/react/components/rename_channel_modal.jsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/web/react/components/rename_channel_modal.jsx b/web/react/components/rename_channel_modal.jsx index 80f0956f2..f355ea9b2 100644 --- a/web/react/components/rename_channel_modal.jsx +++ b/web/react/components/rename_channel_modal.jsx @@ -118,9 +118,13 @@ export default class RenameChannelModal extends React.Component { const button = $(e.relatedTarget); this.setState({displayName: button.attr('data-display'), channelName: button.attr('data-name'), channelId: button.attr('data-channelid')}); } + handleShown() { + $('#rename_channel #display_name').focus(); + } componentDidMount() { $(ReactDOM.findDOMNode(this.refs.modal)).on('show.bs.modal', this.handleShow); $(ReactDOM.findDOMNode(this.refs.modal)).on('hidden.bs.modal', this.handleClose); + $(ReactDOM.findDOMNode(this.refs.modal)).on('shown.bs.modal', this.handleShown); } componentWillUnmount() { $(ReactDOM.findDOMNode(this.refs.modal)).off('hidden.bs.modal', this.handleClose); @@ -176,6 +180,7 @@ export default class RenameChannelModal extends React.Component { onChange={this.onDisplayNameChange} type='text' ref='displayName' + id='display_name' className='form-control' placeholder='Enter display name' value={this.state.displayName} |