refactored code

This commit is contained in:
nostradamos 2018-01-03 01:50:03 +01:00
parent 36df3acf4d
commit e543f55572

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;
}
});
}