diff options
author | unarist <m.unarist@gmail.com> | 2017-09-16 07:32:43 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-09-16 00:32:43 +0200 |
commit | 6c81f9d6e553d2e9346514d1b1c8c214c317fed4 (patch) | |
tree | d77f4ee4c96e26ca11e61a7a502c0c09d3b6a694 /app | |
parent | 472df245799949631646f90d894486e4dbeaaaf9 (diff) |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/components/load_more.js | 2 | ||||
-rw-r--r-- | 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 e2fe1fed7..c4c8c94a2 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 ( - <button className='load-more' disabled={!visible} style={{ opacity: visible ? 1 : 0 }} onClick={this.props.onClick}> + <button className='load-more' disabled={!visible} style={{ visibility: visible ? 'visible' : 'hidden' }} onClick={this.props.onClick}> <FormattedMessage id='status.load_more' defaultMessage='Load more' /> </button> ); diff --git a/app/javascript/mastodon/components/scrollable_list.js b/app/javascript/mastodon/components/scrollable_list.js index 3d78b3ffa..ff0540e5d 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 = <LoadMore visible={!isLoading && childrenCount > 0 && hasMore} onClick={this.handleLoadMore} />; + const loadMore = (hasMore && childrenCount > 0) ? <LoadMore visible={!isLoading} onClick={this.handleLoadMore} /> : null; let scrollableArea = null; if (isLoading || childrenCount > 0 || !emptyMessage) { |