auto-animate icon indicating copy to clipboard operation
auto-animate copied to clipboard

Animation bug when remove element

Open DonSalvador opened this issue 3 years ago • 4 comments

When the wrapper is positioned at the bottom, a bug is shown in the animation when removing an item. Reproduction with Vue

DonSalvador avatar Aug 13 '22 16:08 DonSalvador

I encountered the same issue in a react project, implementing a snackbar-like component.

vixducis avatar Sep 18 '22 21:09 vixducis

This seems to occur less often with a higher duration, which points to maybe a race condition in calculating the element's offset vs starting its animation.

galaxyblur avatar Jan 23 '23 17:01 galaxyblur

Same issue for me in a React project. I have two containers in a flex context (with flex-direction: column) and the second container is pushed to the bottom using margin-top: auto, which contains an animated <ul> list that is suffering the same jankiness when deleting items as OP

syropian avatar Feb 23 '23 16:02 syropian

Not sure if this is exactly the same issue, but vertical centering also causes a glitch on exit. If you apply these styles to the demo at https://auto-animate.formkit.com/ , then elements pop upwards when you remove them from the list:

#demo > div > [data-has-animation=true] {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

drmercer avatar Sep 18 '23 18:09 drmercer