about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-05-06 22:26:39 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-05-06 22:26:39 +0200
commite06fbc4fcfbaaa2d420cbbace37d7c228a8bfc5b (patch)
tree5f71a7605772fb8c133df67613206717e3d8e7bc /app/javascript
parent5c7bed6bbcc53895272879558640e48f04e2e8b3 (diff)
Fixes/rollback scroll changes (#7387)
* Revert "Do not re-position scroll when loading more (inserting items from below) (#7344)"

This reverts commit 8c601b54ccf530bd193b4500fee439aa4e9162d0.

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

This reverts commit 58852695c8ec490239ed3812f82971f8c1e6c172.
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/components/scrollable_list.js13
1 files changed, 2 insertions, 11 deletions
diff --git a/app/javascript/mastodon/components/scrollable_list.js b/app/javascript/mastodon/components/scrollable_list.js
index 7cdd63910..fd6858d05 100644
--- a/app/javascript/mastodon/components/scrollable_list.js
+++ b/app/javascript/mastodon/components/scrollable_list.js
@@ -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}