virtual
virtual copied to clipboard
Svelte: setting count does not re-render correctly
Describe the bug
The virtual list is not updated after setting the count option
Your minimal, reproducible example
https://svelte.dev/playground/61de6ef02eee43088d2ee0482cbe21d3?version=5.25.3
Steps to reproduce
given a scroll area larger than the list it includes when count is updated then nothing happens.
Expected behavior
I would've expected the list to rerender with the updated count, showing new items.
This seems to be resolved by calling $virtualizer.measure() after the setOptions call.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
MacOS, Chromium
tanstack-virtual version
v3.13.5
TypeScript version
No response
Additional context
No response
Terms & Code of Conduct
- [x] I agree to follow this project's Code of Conduct
- [x] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
This may be related to #363.
I have observed the same bug with @tanstack/[email protected]. Wrapping useVirtualizer within computed to work around this.