joshwcomeau / react-flip-move

Effortless animation between DOM changes (eg. list reordering) using the FLIP technique.
http://joshwcomeau.github.io/react-flip-move/examples
MIT License
4.09k stars 258 forks source link

Animate nested list items #207

Closed Tsourdox closed 6 years ago

Tsourdox commented 6 years ago

Thx for this amazing component!

I'm curious to know if it is possible to animate when moving an item from a nested list to another, like this:

<FlipMove>
  <div key="list-a">
    <div key="a">Banana</div>
    <div key="b">Orange</div>
  </div>
  <div key="list-b">
    <div key="c">Apple</div>
  </div>
</FlipMove>

If let's say "Orange" was moved to list-b next to "Apple".

Or possibly group multiple FlipMove components together, something like this:

<div>
  <FlipMove group="fruit-list">
    <div key="a">Banana</div>
    <div key="b">Orange</div>
  </FlipMove>
  <FlipMove group="fruit-list">
    <div key="c">Apple</div>
  </FlipMove>
</div>
tobilen commented 6 years ago

tricky. but maybe there is an easier solve for your problem. why do you need to keep the elements in separate lists?

Tsourdox commented 6 years ago

The list is based on groups, but I'll probably change to list to a single one and just make it look like groups with css. Thx!