TanStack / virtual

🤖 Headless UI for Virtualizing Large Element Lists in JS/TS, React, Solid, Vue and Svelte

Home Page:https://tanstack.com/virtual

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

solid-virtual: UI not updating when ```count``` changes in ```createVirtualizer``` parameters

rrajaste opened this issue · comments

Describe the bug

UI doesn't update when changing the count signal passed as a parameter to virtualizer

Your minimal, reproducible example

https://codesandbox.io/p/devbox/solidjs-tanstack-virtual-forked-67sdkh?file=%2Fsrc%2FApp.tsx%3A14%2C6&workspaceId=2c68d57c-2197-4b47-923d-3e4f5f971951

Steps to reproduce

Change the value inside "Row count" input on top of the list to update the count signal

Expected behavior

Virtualizer should update UI to render the correct count for rows.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Code sandbox

tanstack-virtual version

v3.0.4

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.

@rrajaste, I found solution: use get count() {return signal()} instead of count: signal()

btw this at least should be mentioned in docs

Thanks for the workaround, it seems to fix the issue. Although I think something like this should be hidden under the interface of createVirtualizer. Perhaps count should be a function in the createVirtualizer interface?

Just wanted to note for others that in version 3.5.1, a reactive count using the get syntax still did not work. Once I upgraded to 3.7.0 it did.