diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-04-01 10:23:50 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-04-01 10:23:50 -0400 |
commit | 5e307532d8bd2cd79020dcace7c0c2347a830d34 (patch) | |
tree | 72c5ae513b66db32dfcfa252a8475c77cbb16df5 /webapp | |
parent | d4442b002ee28085f7e8e53612fe0ee80606c8d5 (diff) | |
parent | 1788070f87b98c74a4edb433a2cd3eafe3ca0e5d (diff) | |
download | chat-5e307532d8bd2cd79020dcace7c0c2347a830d34.tar.gz chat-5e307532d8bd2cd79020dcace7c0c2347a830d34.tar.bz2 chat-5e307532d8bd2cd79020dcace7c0c2347a830d34.zip |
Merge pull request #2600 from mattermost/new-messages-fix
PLT-2473 Fixing new messages jump
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/components/posts_view.jsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/webapp/components/posts_view.jsx b/webapp/components/posts_view.jsx index 917411549..ffe04daa1 100644 --- a/webapp/components/posts_view.jsx +++ b/webapp/components/posts_view.jsx @@ -308,7 +308,7 @@ export default class PostsView extends React.Component { if (this.props.scrollType === PostsView.SCROLL_TYPE_BOTTOM) { this.scrollToBottom(); } else if (this.props.scrollType === PostsView.SCROLL_TYPE_NEW_MESSAGE) { - window.requestAnimationFrame(() => { + window.setTimeout(window.requestAnimationFrame(() => { // If separator exists scroll to it. Otherwise scroll to bottom. if (this.refs.newMessageSeparator) { var objDiv = this.refs.postlist; @@ -316,7 +316,7 @@ export default class PostsView extends React.Component { } else if (this.refs.postlist) { this.refs.postlist.scrollTop = this.refs.postlist.scrollHeight; } - }); + }), 0); } else if (this.props.scrollType === PostsView.SCROLL_TYPE_POST && this.props.scrollPostId) { window.requestAnimationFrame(() => { const postNode = ReactDOM.findDOMNode(this.refs[this.props.scrollPostId]); |