summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-10-20 14:26:15 -0400
committerCorey Hulen <corey@hulen.com>2016-10-20 11:26:15 -0700
commit0c663216cc52f6cccdab23a28d0420d4b30e7149 (patch)
tree4d5dcd73b47ba71fe89234d5c3fe0d55ce0ba6f2 /webapp/components/post_view
parent6d7da26af0ebd9143486316a3b2243bd37fdbffc (diff)
downloadchat-0c663216cc52f6cccdab23a28d0420d4b30e7149.tar.gz
chat-0c663216cc52f6cccdab23a28d0420d4b30e7149.tar.bz2
chat-0c663216cc52f6cccdab23a28d0420d4b30e7149.zip
Fix scrolling issues caused by performance branch (#4285)
Diffstat (limited to 'webapp/components/post_view')
-rw-r--r--webapp/components/post_view/components/post_list.jsx6
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]);