summaryrefslogtreecommitdiffstats
path: root/webapp/components/channel_switch_modal.jsx
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-09-06 10:57:50 -0300
committerHarrison Healey <harrisonmhealey@gmail.com>2016-09-06 09:57:50 -0400
commit50ea0b5cc47188a3f6bb600bf5e5c98d0486e87e (patch)
tree49f3ccbe37038ff0aeaf56ce2f7b518c03a4c034 /webapp/components/channel_switch_modal.jsx
parentea52b2a1ad990d947efa3a2be6d32d3856d02713 (diff)
downloadchat-50ea0b5cc47188a3f6bb600bf5e5c98d0486e87e.tar.gz
chat-50ea0b5cc47188a3f6bb600bf5e5c98d0486e87e.tar.bz2
chat-50ea0b5cc47188a3f6bb600bf5e5c98d0486e87e.zip
PLT-3707 Refocus post textbox when channel switcher exits (#3955)
Diffstat (limited to 'webapp/components/channel_switch_modal.jsx')
-rw-r--r--webapp/components/channel_switch_modal.jsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/webapp/components/channel_switch_modal.jsx b/webapp/components/channel_switch_modal.jsx
index 18e0f9f59..a962b5880 100644
--- a/webapp/components/channel_switch_modal.jsx
+++ b/webapp/components/channel_switch_modal.jsx
@@ -16,7 +16,7 @@ import * as Utils from 'utils/utils.jsx';
import * as ChannelActions from 'actions/channel_actions.jsx';
import React from 'react';
-
+import $ from 'jquery';
export default class SwitchChannelModal extends React.Component {
constructor() {
super();
@@ -24,6 +24,7 @@ export default class SwitchChannelModal extends React.Component {
this.onInput = this.onInput.bind(this);
this.onShow = this.onShow.bind(this);
this.onHide = this.onHide.bind(this);
+ this.onExited = this.onExited.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.suggestionProviders = [new SwitchChannelProvider()];
@@ -57,6 +58,12 @@ export default class SwitchChannelModal extends React.Component {
this.props.onHide();
}
+ onExited() {
+ setTimeout(() => {
+ $('#post_textbox').get(0).focus();
+ });
+ }
+
onInput(e) {
this.setState({text: e.target.value});
}
@@ -99,6 +106,7 @@ export default class SwitchChannelModal extends React.Component {
ref='modal'
show={this.props.show}
onHide={this.onHide}
+ onExited={this.onExited}
>
<Modal.Header closeButton={true}>
<Modal.Title>