Is it possible to cancel virtualizer's scrollToIndex? #1128
Unanswered
kristalshards
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I have encountered a situation which is as follows:
A component (let's call it Table) that is rendered receives a
loadingprop. If this prop is true, it returns early by rendering an indicator. If not, I am rendering a bunch of stuff, including a Container which has a ref callback attached to it and that is sent touseVirtualizer()getScrollElementand its children is another component that maps overvirtualizer.getVirtualItems(). So in other words:Upon clicking a toggle, I want to scroll to a specific index (using scrollToIndex function provided by virtualizer). Now the problem is this:
TypeError: Cannot read properties of null (reading 'requestAnimationFrame')=> coming from this:My question, is it possible to cancel this scrollToIndex function once it's initiated? Or how can I think as a mental model to fix this issue?
Beta Was this translation helpful? Give feedback.
All reactions