Top animation not getting applied
I am trying to create an app similar to beatiful-dnd where if we move a card to a new position, other cards make space for it either by moving upwards or downwards. What I tried doing was display a list of cards and rearrange their orders when a drag event takes place. Now while this works I also want to add some animation whie the cards move to the top or bottom. For that I have an array where i store the top positions of each card wrt the container. Now as the cards get rearranged, a new top value is assigned to each component and an animation (top ease 0.5s) is applied. Now the problem is that every time I move a card upwards, the cards above dont wait for the animation to get applied to it whereas every time I move a card downwards, everything works as desired. Can you guys help me with this. Also, I am new here so please be kind 🙂