grid icon indicating copy to clipboard operation
grid copied to clipboard

Auto-height rows desync when sizes.rowHeight changes at runtime (measurement cache not invalidated)

Open guilherme-n-l opened this issue 5 months ago • 2 comments

With autoRowHeight enabled, changing sizes.rowHeight at runtime while the grid is scrolled away from the top corrupts the layout: the rendered rows are mispositioned, the scroll-body height (.wx-body) is wrong, and the view "jumps" to unrelated rows. It looks correct when scrolled to the very top, so it's intermittent depending on scroll state.

Expected: changing sizes.rowHeight re-lays-out rows consistently, preserving the user's logical scroll position. Actual: the layout desyncs because stale per-row measurements are mixed with the new default height.

Suggested fix: invalidate the rowHeights cache (and renderedHeight/renderEnd) when sizes.rowHeight changes / on store re-init, or expose an API to force a full re-measure. (Per-row rowHeight on data items works fine, since it doesn't go through this cache.)

guilherme-n-l avatar Jun 23 '26 16:06 guilherme-n-l

DEMO: https://stackblitz.com/edit/vitejs-vite-awhqosgx?file=vite.config.ts

Image

guilherme-n-l avatar Jun 23 '26 16:06 guilherme-n-l

Hello @guilherme-n-l ,

Thanks for the clear report. We can confirm that this is a bug. We will fix it in one of the upcoming releases and notify you as soon as it is fixed.

Natasha-eng avatar Jun 25 '26 08:06 Natasha-eng