Fix scrolling issues caused by performance branch (#4285)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
6d7da26af0
Коммит
0c663216cc
@@ -392,15 +392,15 @@ export default class PostList extends React.Component {
|
|||||||
if (this.props.scrollType === ScrollTypes.BOTTOM) {
|
if (this.props.scrollType === ScrollTypes.BOTTOM) {
|
||||||
this.scrollToBottom();
|
this.scrollToBottom();
|
||||||
} else if (this.props.scrollType === ScrollTypes.NEW_MESSAGE) {
|
} 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 separator exists scroll to it. Otherwise scroll to bottom.
|
||||||
if (this.refs.newMessageSeparator) {
|
if (this.refs.newMessageSeparator) {
|
||||||
var objDiv = this.refs.postlist;
|
var objDiv = this.refs.postlist;
|
||||||
objDiv.scrollTop = this.refs.newMessageSeparator.offsetTop; //scrolls node to top of Div
|
objDiv.scrollTop = this.refs.newMessageSeparator.offsetTop; //scrolls node to top of Div
|
||||||
} else if (this.refs.postlist) {
|
} 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) {
|
} else if (this.props.scrollType === ScrollTypes.POST && this.props.scrollPostId) {
|
||||||
window.requestAnimationFrame(() => {
|
window.requestAnimationFrame(() => {
|
||||||
const postNode = ReactDOM.findDOMNode(this.refs[this.props.scrollPostId]);
|
const postNode = ReactDOM.findDOMNode(this.refs[this.props.scrollPostId]);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user