Skip to content
Snippets Groups Projects
Commit e06fbc4f authored by ThibG's avatar ThibG Committed by Eugen Rochko
Browse files

Fixes/rollback scroll changes (#7387)

* Revert "Do not re-position scroll when loading more (inserting items from below) (#7344)"

This reverts commit 8c601b54.

* Revert "Prevent timeline from moving when cursor is hovering over it (fixes #7278) (#7327)"

This reverts commit 58852695.
parent 5c7bed6b
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,6 @@ export default class ScrollableList extends PureComponent {
state = {
fullscreen: null,
mouseOver: false,
};
intersectionObserverWrapper = new IntersectionObserverWrapper();
......@@ -72,7 +71,7 @@ export default class ScrollableList extends PureComponent {
const someItemInserted = React.Children.count(prevProps.children) > 0 &&
React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&
this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);
if (someItemInserted && this.node.scrollTop > 0 || (this.state.mouseOver && !prevProps.isLoading)) {
if (someItemInserted && this.node.scrollTop > 0) {
return this.node.scrollHeight - this.node.scrollTop;
} else {
return null;
......@@ -140,14 +139,6 @@ export default class ScrollableList extends PureComponent {
this.props.onLoadMore();
}
handleMouseEnter = () => {
this.setState({ mouseOver: true });
}
handleMouseLeave = () => {
this.setState({ mouseOver: false });
}
render () {
const { children, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage, onLoadMore } = this.props;
const { fullscreen } = this.state;
......@@ -158,7 +149,7 @@ export default class ScrollableList extends PureComponent {
if (isLoading || childrenCount > 0 || !emptyMessage) {
scrollableArea = (
<div className={classNames('scrollable', { fullscreen })} ref={this.setRef} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
<div className={classNames('scrollable', { fullscreen })} ref={this.setRef}>
<div role='feed' className='item-list'>
{prepend}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment