From 50ea0b5cc47188a3f6bb600bf5e5c98d0486e87e Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 6 Sep 2016 10:57:50 -0300 Subject: PLT-3707 Refocus post textbox when channel switcher exits (#3955) --- webapp/components/channel_switch_modal.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'webapp') 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} > -- cgit v1.2.3-1-g7c22