[PLT-5445] Mobile view: Set focus back to message box after uploading a file (#5360)

Этот коммит содержится в:
Saturnino Abril
2017-02-23 17:57:41 +09:00
коммит произвёл George Goldberg
родитель 9220254f05
Коммит f6d22ee4f0
3 изменённых файлов: 19 добавлений и 10 удалений

Просмотреть файл

@@ -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}