summaryrefslogtreecommitdiffstats
path: root/web/react/components/edit_channel_modal.jsx
diff options
context:
space:
mode:
authorAsaad Mahmood <Unknowngi@live.com>2015-11-04 20:07:58 +0500
committerAsaad Mahmood <Unknowngi@live.com>2015-11-04 22:37:26 +0500
commit71035bfdc796093a2904747a67468249c4ba6edf (patch)
tree04be3f1886594c904bcd0f5a4f29aa8e0a49349e /web/react/components/edit_channel_modal.jsx
parent2840c317e5a88264aa044261558dda6d91ee1ff3 (diff)
downloadchat-71035bfdc796093a2904747a67468249c4ba6edf.tar.gz
chat-71035bfdc796093a2904747a67468249c4ba6edf.tar.bz2
chat-71035bfdc796093a2904747a67468249c4ba6edf.zip
Adding focus for channel modals
Diffstat (limited to 'web/react/components/edit_channel_modal.jsx')
-rw-r--r--web/react/components/edit_channel_modal.jsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/react/components/edit_channel_modal.jsx b/web/react/components/edit_channel_modal.jsx
index 5b3c74e82..58f2cdbed 100644
--- a/web/react/components/edit_channel_modal.jsx
+++ b/web/react/components/edit_channel_modal.jsx
@@ -55,9 +55,13 @@ export default class EditChannelModal extends React.Component {
const button = e.relatedTarget;
this.setState({header: $(button).attr('data-header'), title: $(button).attr('data-title'), channelId: $(button).attr('data-channelid'), serverError: ''});
}
+ handleShown() {
+ $('#edit_channel #edit_header').focus();
+ }
componentDidMount() {
$(ReactDOM.findDOMNode(this.refs.modal)).on('show.bs.modal', this.onShow);
$(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);
@@ -114,6 +118,7 @@ export default class EditChannelModal extends React.Component {
<textarea
className='form-control no-resize'
rows='6'
+ id='edit_header'
maxLength='1024'
value={this.state.header}
onChange={this.handleUserInput}