Fixed pasting images not working (#5971)

Этот коммит содержится в:
Harrison Healey
2017-04-04 12:25:55 -04:00
коммит произвёл Joram Wilander
родитель e2a8b3d47e
Коммит 6ae3464484
3 изменённых файлов: 17 добавлений и 4 удалений

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

@@ -51,6 +51,7 @@ export default class CreateComment extends React.Component {
this.handleUploadError = this.handleUploadError.bind(this);
this.removePreview = this.removePreview.bind(this);
this.getFileCount = this.getFileCount.bind(this);
this.getFileUploadTarget = this.getFileUploadTarget.bind(this);
this.onPreferenceChange = this.onPreferenceChange.bind(this);
this.focusTextbox = this.focusTextbox.bind(this);
this.showPostDeletedModal = this.showPostDeletedModal.bind(this);
@@ -497,6 +498,10 @@ export default class CreateComment extends React.Component {
return this.state.fileInfos.length + this.state.uploadsInProgress.length;
}
getFileUploadTarget() {
return this.refs.textbox;
}
focusTextbox(keepFocus = false) {
if (keepFocus || !Utils.isMobile()) {
this.refs.textbox.focus();
@@ -612,6 +617,7 @@ export default class CreateComment extends React.Component {
<FileUpload
ref='fileUpload'
getFileCount={this.getFileCount}
getTarget={this.getFileUploadTarget}
onFileUploadChange={this.handleFileUploadChange}
onUploadStart={this.handleUploadStart}
onFileUpload={this.handleFileUploadComplete}