mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
PLT-3707 Refocus post textbox when channel switcher exits (#3955)
This commit is contained in:
parent
ea52b2a1ad
commit
50ea0b5cc4
1 changed files with 9 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue