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
I'm trying to implement smooth scrolling on a virtual table but running into issues. I've cloned the virtualized infinite scrolling example from the TanStack Table documentation, and added the relevant pieces from the smooth scrolling example in the TanStack Virtual documentation. Specifically, I added the following:
When smooth scrolling is disabled (i.e. the scrollToFn is not passed as an argument to useVirtualizer), the functionality works as expected, minus the smooth scrolling aspect (which is expected)
I added a log statement to the scrollToFn and noticed that it's called infinitely many times after clicking the "scroll to" button once.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to implement smooth scrolling on a virtual table but running into issues. I've cloned the virtualized infinite scrolling example from the TanStack Table documentation, and added the relevant pieces from the smooth scrolling example in the TanStack Virtual documentation. Specifically, I added the following:
scrollToFn
functioneaseInOutQuint
functionscrollingRef
refscrollToFn
touseVirtualizer
Here's a CodeSandbox with the app.
A couple observations:
scrollToFn
is not passed as an argument touseVirtualizer
), the functionality works as expected, minus the smooth scrolling aspect (which is expected)scrollToFn
and noticed that it's called infinitely many times after clicking the "scroll to" button once.Beta Was this translation helpful? Give feedback.
All reactions