virtual icon indicating copy to clipboard operation
virtual copied to clipboard

fix #376: flushing the item ref function and forcing a remeasurement

Open carlosbaraza opened this issue 1 year ago • 1 comments

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 avatar Aug 21 '22 10:08 carlosbaraza

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

carlosbaraza avatar Aug 21 '22 10:08 carlosbaraza

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();

badsyntax avatar Sep 21 '22 16:09 badsyntax