1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-08 21:42:24 +03:00

focus editor after clicking edit

This commit is contained in:
Bruno Windels
2019-05-15 17:17:35 +01:00
parent d73f547f55
commit 085f2d199d

View File

@@ -144,6 +144,13 @@ export default class MessageEditor extends React.Component {
componentDidMount() { componentDidMount() {
this._updateEditorState(); this._updateEditorState();
const sel = document.getSelection();
const range = document.createRange();
range.selectNodeContents(this._editorRef);
range.collapse(false);
sel.removeAllRanges();
sel.addRange(range);
this._editorRef.focus();
} }
render() { render() {