refactored code
This commit is contained in:
parent
36df3acf4d
commit
e543f55572
1 changed files with 3 additions and 2 deletions
|
@ -512,8 +512,9 @@ export default class MessageComposerInput extends React.Component {
|
||||||
// composer. For some reason the editor won't scroll automatically if we paste
|
// composer. For some reason the editor won't scroll automatically if we paste
|
||||||
// blocks of text in or insert newlines.
|
// blocks of text in or insert newlines.
|
||||||
if (textContent.slice(selection.start).indexOf("\n") === -1) {
|
if (textContent.slice(selection.start).indexOf("\n") === -1) {
|
||||||
this.refs.editor.refs.editor.parentNode.parentNode.scrollTop = this.
|
let editorRoot = this.refs.editor.refs.editor.parentNode.parentNode;
|
||||||
refs.editor.refs.editor.parentNode.parentNode.scrollHeight;
|
console.log(editorRoot, editorRoot.scrollHeight);
|
||||||
|
editorRoot.scrollTop = editorRoot.scrollHeight;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue