formkit / auto-animate

A zero-config, drop-in animation utility that adds smooth transitions to your web app. You can use it with React, Vue, or any other JavaScript application.
https://auto-animate.formkit.com
MIT License
12.59k stars 224 forks source link

Animation starting coords are buggy when the container has transitioned positions #195

Open samueleiche opened 7 months ago

samueleiche commented 7 months ago

In our app we have stacked modals that slide in-out on top of each other. Items can be added from one modal and corresponding lists change in another modal. When an item is added, the modal closes and the modal under re-positions itself.

I wanted to try this library in our app, which includes the modals case, but found that the animation starting coords are not calculated properly if an ancestor element container has changed position.

Here's how it can be replicated

This can happen even if the container has finished animating.

Seems like edge case, but it isn't really in more dynamic apps.