refactored code

pull/21833/head
nostradamos 2018-01-03 01:50:03 +01:00
parent 36df3acf4d
commit e543f55572
1 changed files with 3 additions and 2 deletions

View File

@ -512,8 +512,9 @@ export default class MessageComposerInput extends React.Component {
// composer. For some reason the editor won't scroll automatically if we paste
// blocks of text in or insert newlines.
if (textContent.slice(selection.start).indexOf("\n") === -1) {
this.refs.editor.refs.editor.parentNode.parentNode.scrollTop = this.
refs.editor.refs.editor.parentNode.parentNode.scrollHeight;
let editorRoot = this.refs.editor.refs.editor.parentNode.parentNode;
console.log(editorRoot, editorRoot.scrollHeight);
editorRoot.scrollTop = editorRoot.scrollHeight;
}
});
}