Describe the bug
Changing gap after mount does not recompute item start or getTotalSize().
The list keeps the layout from the old gap.
The same value on a fresh mount lays out correctly, so only the dynamic update path is broken (remount is the only workaround).
Your minimal, reproducible example
https://stackblitz.com/~/github.com/2wheeh/virtual-gap-dynamic-repro
Steps to reproduce
- Click gap 40 (
setState → re-render with the new gap).
- See the rendered gap is stale:
actual starts [0, 50, 100, 150, 200] total 250 // stale gap=0 layout
expected starts [0, 90, 180, 270, 360] total 410
- Click Remount (workaround): the same
gap: 40 lays out correctly.
Expected behavior
Updating gap should invalidate the measurements, keeping the layout reactive to option changes.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
not platform-specific
tanstack-virtual version
@tanstack/react-virtual 3.14.5 / @tanstack/virtual-core 3.17.3
TypeScript version
No response
Additional context
No response
Terms & Code of Conduct
Describe the bug
Changing
gapafter mount does not recompute itemstartorgetTotalSize().The list keeps the layout from the old
gap.The same value on a fresh mount lays out correctly, so only the dynamic update path is broken (remount is the only workaround).
Your minimal, reproducible example
https://stackblitz.com/~/github.com/2wheeh/virtual-gap-dynamic-repro
Steps to reproduce
setState→ re-render with the newgap).gap: 40lays out correctly.Expected behavior
Updating gap should invalidate the measurements, keeping the layout reactive to option changes.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
not platform-specific
tanstack-virtual version
@tanstack/react-virtual3.14.5 /@tanstack/virtual-core3.17.3TypeScript version
No response
Additional context
No response
Terms & Code of Conduct