restore focus_composer action

This commit is contained in:
Bruno Windels 2019-08-07 15:14:16 +02:00
parent d4ca087abe
commit e39c405c55
2 changed files with 14 additions and 0 deletions

View file

@ -241,4 +241,8 @@ export default class BasicMessageEditor extends React.Component {
></div>
</div>);
}
focus() {
this._editorRef.focus();
}
}

View file

@ -82,13 +82,23 @@ export default class SendMessageComposer extends React.Component {
const {caret} = getCaretOffsetAndText(this._editorRef, sel);
const parts = this.model.serializeParts();
this.props.editState.setEditorState(caret, parts);
dis.unregister(this.dispatcherRef);
}
componentWillMount() {
const partCreator = new PartCreator(this.props.room, this.context.matrixClient);
this.model = new EditorModel([], partCreator);
this.dispatcherRef = dis.register(this.onAction);
}
onAction = (payload) => {
switch (payload.action) {
case 'focus_composer':
this._editorRef.focus();
break;
}
};
render() {
// <div className="mx_MessageComposer_autocomplete_wrapper">
// </div>