Is it possible to animate Flexbox inserts & removes?

前端 未结 6 2127
时光取名叫无心
时光取名叫无心 2020-12-09 07:41

When I remove an item from a flexbox, the remaining items \"snap\" into their new positions immediately rather than animating.

Conceptually, since the items are chan

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 07:45

    I accidentally got it to work in a simple way. Basically, you set width:0;flex-grow:1 and of course add transition:all 2s; and that's it. It's a curious hack.

    See it working

提交回复
热议问题