Skip to content

Svelte: setting count does not re-render correctly #969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
nordfjord opened this issue Mar 28, 2025 · 1 comment
Open
2 tasks done

Svelte: setting count does not re-render correctly #969

nordfjord opened this issue Mar 28, 2025 · 1 comment

Comments

@nordfjord
Copy link

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

  • 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.
@shniubobo
Copy link

This may be related to #363.

I have observed the same bug with @tanstack/vue-virtual@3.13.6. Wrapping useVirtualizer within computed to work around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants