summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-01-13 15:03:12 +0000
committerGitHub <noreply@github.com>2017-01-13 15:03:12 +0000
commit07bad4d6d518a9012a20fec8309cd625f57c7a8c (patch)
treea2d53e45620fbeea3a162b0f5a599085e5ca0dd0
parentd64d51a632f940efbdca6fa3277b555eb58bb2d2 (diff)
downloadchat-07bad4d6d518a9012a20fec8309cd625f57c7a8c.tar.gz
chat-07bad4d6d518a9012a20fec8309cd625f57c7a8c.tar.bz2
chat-07bad4d6d518a9012a20fec8309cd625f57c7a8c.zip
PLT-5025: Fix scroll to bottom delay loading channel. (#5056)
-rw-r--r--webapp/components/post_view/components/post_list.jsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx
index 29358122b..06542d39c 100644
--- a/webapp/components/post_view/components/post_list.jsx
+++ b/webapp/components/post_view/components/post_list.jsx
@@ -421,6 +421,11 @@ export default class PostList extends React.Component {
this.scrollToBottom();
}
});
+
+ // This avoids the scroll jumping from top to bottom after the page has rendered (PLT-5025).
+ if (!this.refs.newMessageSeparator) {
+ this.scrollToBottom();
+ }
} else if (this.props.scrollType === ScrollTypes.POST && this.props.scrollPostId) {
window.requestAnimationFrame(() => {
const postNode = ReactDOM.findDOMNode(this.refs[this.props.scrollPostId]);