virtual icon indicating copy to clipboard operation
virtual copied to clipboard

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

Open rrajaste opened this issue 1 year ago • 4 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

  • [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.

rrajaste avatar Feb 04 '24 12:02 rrajaste

same here https://github.com/barsikus007/deb-ounce/tree/blazing-slow

barsikus007 avatar Feb 11 '24 16:02 barsikus007

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

btw this at least should be mentioned in docs

barsikus007 avatar Feb 11 '24 16:02 barsikus007

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?

rrajaste avatar Feb 13 '24 11:02 rrajaste

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.

wilgaboury avatar Jun 21 '24 13:06 wilgaboury