virtual
virtual copied to clipboard
InitialOffset seems to have no effect.
Describe the bug
I tried to apply initialOffset to useVirtualizer, but it had no effect.
Your minimal, reproducible example
https://codesandbox.io/s/initialoffset-test-lttgyh
Steps to reproduce
See the sandbox.
Expected behavior
I expect a scrollOffset.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
-OS Linux Ubuntu Browser: Firefox 103.0b9 (64-bit)
tanstack-virtual version
^3.0.0-beta.9
TypeScript version
No response
Additional context
It would be great if you could also define which index is initially visible. Is something like this planned? I.e.
const rowVirtualizer = useVirtualizer({
count: data.length,
initialIndex: { index, options: { align: "center" } },
getScrollElement: () => tableContainer.current,
estimateSize: () => 21,
overscan: 3,
});
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.