mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
restore focus_composer action
This commit is contained in:
parent
d4ca087abe
commit
e39c405c55
2 changed files with 14 additions and 0 deletions
|
@ -241,4 +241,8 @@ export default class BasicMessageEditor extends React.Component {
|
|||
></div>
|
||||
</div>);
|
||||
}
|
||||
|
||||
focus() {
|
||||
this._editorRef.focus();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue