PLT-5025: Fix scroll to bottom delay loading channel. (#5056)

This commit is contained in:
George Goldberg
2017-01-13 15:03:12 +00:00
committed by GitHub
parent d64d51a632
commit 07bad4d6d5

View File

@@ -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]);