0
0
Fork 0

Replace onScrollToBottom with onLoadMore (#6615)

onScrollToBottom was a function to run instead of onScrollToTop and
onScroll when scrolling to the bottom. The behavior to prevent
onScrollToTop was inconvenient because the viewport can be at the bottom
and at the top at the same time if the viewport is larger than the
container.

onScrollToBottom was also called when the button to load more is clicked
on contray to the name suggests, which led notifications and
status_list_container components to mark the scrolled location is not at
the top mistakenly.

onLoadMore is a replacement for onScrollToBottom. It will be called
independently from onScrollToTop and onScroll.
This commit is contained in:
Akihiko Odaki 2018-03-06 03:31:40 +09:00 committed by Eugen Rochko
parent a38dbd9c8a
commit b0664a5e6c
6 changed files with 16 additions and 18 deletions

View file

@ -62,7 +62,7 @@ export default class Favourites extends ImmutablePureComponent {
this.column = c;
}
handleScrollToBottom = debounce(() => {
handleLoadMore = debounce(() => {
this.props.dispatch(expandFavouritedStatuses());
}, 300, { leading: true })
@ -89,7 +89,7 @@ export default class Favourites extends ImmutablePureComponent {
scrollKey={`favourited_statuses-${columnId}`}
hasMore={hasMore}
isLoading={isLoading}
onScrollToBottom={this.handleScrollToBottom}
onLoadMore={this.handleLoadMore}
/>
</Column>
);