diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-10-20 14:26:15 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-10-20 11:26:15 -0700 |
commit | 0c663216cc52f6cccdab23a28d0420d4b30e7149 (patch) | |
tree | 4d5dcd73b47ba71fe89234d5c3fe0d55ce0ba6f2 /webapp/components | |
parent | 6d7da26af0ebd9143486316a3b2243bd37fdbffc (diff) | |
download | chat-0c663216cc52f6cccdab23a28d0420d4b30e7149.tar.gz chat-0c663216cc52f6cccdab23a28d0420d4b30e7149.tar.bz2 chat-0c663216cc52f6cccdab23a28d0420d4b30e7149.zip |
Fix scrolling issues caused by performance branch (#4285)
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/post_view/components/post_list.jsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx index 46ce0ed67..8e1d58e15 100644 --- a/webapp/components/post_view/components/post_list.jsx +++ b/webapp/components/post_view/components/post_list.jsx @@ -392,15 +392,15 @@ export default class PostList extends React.Component { if (this.props.scrollType === ScrollTypes.BOTTOM) { this.scrollToBottom(); } else if (this.props.scrollType === ScrollTypes.NEW_MESSAGE) { - window.setTimeout(window.requestAnimationFrame(() => { + window.requestAnimationFrame(() => { // If separator exists scroll to it. Otherwise scroll to bottom. if (this.refs.newMessageSeparator) { var objDiv = this.refs.postlist; objDiv.scrollTop = this.refs.newMessageSeparator.offsetTop; //scrolls node to top of Div } else if (this.refs.postlist) { - this.refs.postlist.scrollTop = this.refs.postlist.scrollHeight; + this.scrollToBottom(); } - }), 0); + }); } else if (this.props.scrollType === ScrollTypes.POST && this.props.scrollPostId) { window.requestAnimationFrame(() => { const postNode = ReactDOM.findDOMNode(this.refs[this.props.scrollPostId]); |