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 #376: flushing the item ref function and forcing a remeasurement #377

Closed
wants to merge 1 commit into from

Conversation

carlosbaraza
Copy link

@carlosbaraza carlosbaraza commented Aug 21, 2022

This solution works. However, this the approach taken to flush the cache is not perfect as the table moves around when running measure. The lack of idempotence shows that it could be improved, presumably by maintaining the measurements for non visible items and only recalculating the ones visible.

@carlosbaraza
Copy link
Author

@tannerlinsley do you think we could get this one in before final v3?

@badsyntax
Copy link

badsyntax commented Sep 21, 2022

This change fixes .measure() in my scenario where row element heights have dynamically changed, would be great to see it released.

[edit] This is the workaround i'm using until this change lands

// see: https://github.com/TanStack/virtual/pull/377
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
rowVirtualizer.measureElementCache = {};
rowVirtualizer.measure();

@piecyk
Copy link
Collaborator

piecyk commented Nov 8, 2022

This should not be needed with new approach via #405, checkout latest beta!

@piecyk piecyk closed this Nov 8, 2022
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.

3 participants