From e4b798462423e835f4121d04e419abc2fc32308a Mon Sep 17 00:00:00 2001 From: unarist Date: Sat, 16 Sep 2017 07:32:43 +0900 Subject: [PATCH] Fix invisible load more button (#4962) * Fix behavior while the button is invisible e.g. pointer cursor, couldn't open contextmenu * Avoid rendering the button to remove blank space if no more items are available or no items are rendered --- app/javascript/mastodon/components/load_more.js | 2 +- app/javascript/mastodon/components/scrollable_list.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/components/load_more.js b/app/javascript/mastodon/components/load_more.js index e2fe1fed7e..c4c8c94a2a 100644 --- a/app/javascript/mastodon/components/load_more.js +++ b/app/javascript/mastodon/components/load_more.js @@ -17,7 +17,7 @@ export default class LoadMore extends React.PureComponent { const { visible } = this.props; return ( - ); diff --git a/app/javascript/mastodon/components/scrollable_list.js b/app/javascript/mastodon/components/scrollable_list.js index 3d78b3ffa8..ff0540e5de 100644 --- a/app/javascript/mastodon/components/scrollable_list.js +++ b/app/javascript/mastodon/components/scrollable_list.js @@ -167,7 +167,7 @@ export default class ScrollableList extends PureComponent { const { children, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage } = this.props; const childrenCount = React.Children.count(children); - const loadMore = 0 && hasMore} onClick={this.handleLoadMore} />; + const loadMore = (hasMore && childrenCount > 0) ? : null; let scrollableArea = null; if (isLoading || childrenCount > 0 || !emptyMessage) {