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

VirtualizedList distanceFromEnd calculations should not include the footer height. #797

Open
edkimmel opened this issue Jun 21, 2024 · 0 comments

Comments

@edkimmel
Copy link

Introduction

I believe the calculations around distanceToEnd in VirtualizedList should subtract the footer height.

Details

Our site uses quite a large footer to drive SEO content on our pages. For some pages, this footer can be an entire window size of height or more.

I noticed that renderAhead (virtualization disabled) and I believe onEndReached both include the footer height in their calculations for how close to the end of content the user is currently at.

The issue with this is that, with a large enough footer, the virtualized list will not render additional content until the user has scrolled past the content and are viewing the footer. This causes content to "pop in" above the fold, where they won't see it until scrolled back into view.

Discussion points

We can always keep increasing the onEndReachedThreshold to account for the ever-increasing amount of SEO content shoved into our footer, but this feels wrong. If the goal of the code is to determine how close to the end of the primary content the user is, I believe it would be more correct to take the footer height out of the equation (subtract this._footerLength).

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

No branches or pull requests

1 participant