You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Svelte virtualizer stores reset updated options when resubscribed #1355
After updating a virtualizer's count with setOptions, unsubscribing the last subscriber and subscribing again restores the initial count. This affects a long-lived store reused by a conditionally mounted list: its total size reverts when the list subscribes again.
In the reproduction directory, run npm ci and npm run repro.
The script creates a virtualizer with 10 items, subscribes, and changes its count to 100.
It removes the last subscription and subscribes to the same store again.
Before unsubscribing, the count and total size are 100 4000. After resubscribing, they are 10 400, and the script exits with status 1.
Expected behavior
The same store retains the updated count and total size: 100 4000.
How often does this bug happen?
Every time.
Screenshots or Videos
The reproduction prints the count and total size at each step.
Platform
macOS, Node.js 24.8.0, Svelte 4.2.20. The reproduction exercises the store lifecycle directly without a browser.
tanstack-virtual version
@tanstack/svelte-virtual 3.13.50
TypeScript version
The reproduction uses JavaScript.
Additional context
The existing unit-test setup also reproduces this with createWindowVirtualizer.
Terms & Code of Conduct
I agree to follow this project's Code of Conduct
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.
Activity