focus editor after clicking edit
This commit is contained in:
parent
d73f547f55
commit
085f2d199d
1 changed files with 7 additions and 0 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Reference in a new issue