Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InfiniteScroll lastPage calculation #5806

Merged
merged 1 commit into from Nov 17, 2021

Conversation

MikeKingdom
Copy link
Collaborator

@MikeKingdom MikeKingdom commented Nov 16, 2021

What does this PR do?

InfiniteScroll calculates its lastPage index slightly wrong. This fixes that calculation.

The test snapshot changes are cases where InfiniteScroll really shouldn't have put
a marker div. Most of the cases are pagination enabled (where it doesn't need to
detect that the list is scrolled to the end). The change to the InfiniteScroll snaphot
is a case where it had a number of items that was exactly a multiple of the step
(the main bug this fixes.)

Where should the reviewer start?

InfiniteScroll.js

What testing has been done on this PR?

Storybook plus some special situations with DataTable onUpdate.

How should this be manually tested?

See #5794

Any background context you want to provide?

What are the relevant issues?

Fixes #5794

Screenshots (if appropriate)

Do the grommet docs need to be updated?

No

Should this PR be mentioned in the release notes?

Yes

Is this change backwards compatible or is it a breaking change?

This is backwards compatible

Copy link
Collaborator

@halocline halocline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Mike.

@ericsoderberghp ericsoderberghp merged commit c9d11ab into master Nov 17, 2021
@ericsoderberghp ericsoderberghp deleted the fix/infinitescroll-lastpage branch November 17, 2021 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InfiniteScroll doesn't call onMore enough...calculates lastPage wrong at step boundaries
4 participants