Skip to content

Conversation

@bvaughn
Copy link
Owner

@bvaughn bvaughn commented Sep 23, 2025

I think it would be possible to support optional rowHeight for list items (using ResizeObserver to lazily measure items) though there are a few challenges I have yet to work out:

  • How should scrollToRow work?
  • How should rowProps invalidation work?

How should scrollToRow work?

The most obvious approach to this would be to set an offset based on estimated sizes, but that can lead to bad UX (scroll jumping) when scrolling backwards (the more off the estimated sizes turn out to be, the bigger the scroll-jumps).

You can see examples of this here:

demo720.mov

An unsatisfying solution for this would be to not support that imperative API method for this props configuration.

How should rowProps invalidation work?

Version 1 of this library required external code to manually invalidate row data (by calling an imperative resetAfterIndex method). Version 2 of this library auto-invalidates whenever a value in rowProps change. This makes for a problem with lazily-measured content: What should happen if rowProps changes after the user has scrolled? (Cached sizes and offsets might not be valid anymore, and we can't quickly re-populate the cached bounds.)

An unsatisfying solution for this would be to require explicit invalidation for this props configuration.

@vercel
Copy link

vercel bot commented Sep 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
react-window Ready Ready Preview Sep 28, 2025 6:38pm

@bvaughn
Copy link
Owner Author

bvaughn commented Sep 29, 2025

Closing in favor of #857

@bvaughn bvaughn closed this Sep 29, 2025
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.

2 participants