Animation of row show/hide #413
-
I'm wondering how to implement animation of row closing\opening inside virtual list. Need to implement animation in tree, but I am stuck. I've created an example where I'm trying to reproduce my task https://codesandbox.io/s/react-virtual-tree-nnqp98 Another problem - when I pass a whole list it renders with gaps - where children should be placed. I can filter the list to show only visible items, but then there won't be animation wrapper components. I want to achieve this behavior - nodes are animated and tree works as expected. I have a more complicated case - with dynamic and unknown height of the row, but I found some examples with Resize Observer, which can help me to solve it. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi, overall with animation on rows better is to wrap items with a div and position the whole range and not individual rows. Checkout this example https://codesandbox.io/s/react-virtual-tree-forked-t8f306?file=/src/App.js it's using extracted code from this PR #405 to use Resize Observer to have correct range when item height changes. |
Beta Was this translation helpful? Give feedback.
-
Hello! @piecyk |
Beta Was this translation helpful? Give feedback.
Hi, overall with animation on rows better is to wrap items with a div and position the whole range and not individual rows. Checkout this example https://codesandbox.io/s/react-virtual-tree-forked-t8f306?file=/src/App.js it's using extracted code from this PR #405 to use Resize Observer to have correct range when item height changes.