virtual
virtual copied to clipboard
fix #376: flushing the item ref function and forcing a remeasurement
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.
@tannerlinsley do you think we could get this one in before final v3?
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();
This should not be needed with new approach via #405, checkout latest beta!