Open jmeistrich opened 4 years ago
Thanks! I will look into #114 first, and then pick that for the docs.
Now that you fixed #114 I updated the linked StackBlitz to use scrollingStateChange instead of rangeChanged, and it doesn't need he timeout anymore.
Thanks for the example @jmeistrich . How would you use layoutId
with this? The item jumps all over the place.
@khuezy Unfortunately it's been three years since I made that example and haven't used this library in a while, so I don't know, sorry!
No worries thanks for replying!
I made an animated Virtuoso list using framer-motion and I thought you might like to use it as an example. It makes the ItemContainer an animated motion.div, and uses a feature in framer-motion 2 beta that animates items automatically when their DOM position changes.
It's slightly complex because it requires disabling animations during scroll, or it conflicts with Virtuoso's position algorithms and elements jump around wildly. And it requires computeItemKey to ensure Virtuoso reuses the same item elements.
It would ideally use scrollingStateChange to disable animations, but that's currently being triggered by the list changing (https://github.com/petyosi/react-virtuoso/issues/114) so I'm using rangeChanged as a workaround.
I made a StackBlitz for you based on your prepend example (https://stackblitz.com/edit/react-je5vjv?file=example.js), but here's the code inline too: