summaryrefslogtreecommitdiffstats
path: root/webapp/components/create_comment.jsx
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-02-23 17:57:41 +0900
committerGeorge Goldberg <george@gberg.me>2017-02-23 08:57:41 +0000
commitf6d22ee4f0b7f4954cbad17986f06f9a5f096e72 (patch)
tree62d9e570483b71e92ebdfa6f38eec70877468169 /webapp/components/create_comment.jsx
parent9220254f05b6200de2e8ac78476a8df536c821ec (diff)
downloadchat-f6d22ee4f0b7f4954cbad17986f06f9a5f096e72.tar.gz
chat-f6d22ee4f0b7f4954cbad17986f06f9a5f096e72.tar.bz2
chat-f6d22ee4f0b7f4954cbad17986f06f9a5f096e72.zip
[PLT-5445] Mobile view: Set focus back to message box after uploading a file (#5360)
Diffstat (limited to 'webapp/components/create_comment.jsx')
-rw-r--r--webapp/components/create_comment.jsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx
index d57e61e11..d82eaa3e5 100644
--- a/webapp/components/create_comment.jsx
+++ b/webapp/components/create_comment.jsx
@@ -45,7 +45,7 @@ export default class CreateComment extends React.Component {
this.handleChange = this.handleChange.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
this.handleBlur = this.handleBlur.bind(this);
- this.handleUploadClick = this.handleUploadClick.bind(this);
+ this.handleFileUploadChange = this.handleFileUploadChange.bind(this);
this.handleUploadStart = this.handleUploadStart.bind(this);
this.handleFileUploadComplete = this.handleFileUploadComplete.bind(this);
this.handleUploadError = this.handleUploadError.bind(this);
@@ -314,8 +314,8 @@ export default class CreateComment extends React.Component {
}
}
- handleUploadClick() {
- this.focusTextbox();
+ handleFileUploadChange() {
+ this.focusTextbox(true);
}
handleUploadStart(clientIds) {
@@ -400,9 +400,9 @@ export default class CreateComment extends React.Component {
draft.uploadsInProgress = uploadsInProgress;
PostStore.storeCommentDraft(this.props.rootId, draft);
- const enableAddButton = this.handleEnableAddButton(this.state.message, fileInfos);
+ this.setState({fileInfos, uploadsInProgress});
- this.setState({fileInfos, uploadsInProgress, enableAddButton});
+ this.handleFileUploadChange();
}
componentWillReceiveProps(newProps) {
@@ -524,7 +524,7 @@ export default class CreateComment extends React.Component {
<FileUpload
ref='fileUpload'
getFileCount={this.getFileCount}
- onClick={this.handleUploadClick}
+ onFileUploadChange={this.handleFileUploadChange}
onUploadStart={this.handleUploadStart}
onFileUpload={this.handleFileUploadComplete}
onUploadError={this.handleUploadError}