You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-19 05:22:13 +03:00
restore focus_composer action
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user