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.

Home Page:https://auto-animate.formkit.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature request: enable only the animations we need

yojona opened this issue · comments

It would be great to be able to pass the animations we need, like:

useAutoAnimate(['add', 'remove']);

My app uses react-beautiful-dnd and it doesn't work very well with 'remain', so in cases like this when we use other libraries with animations that might interfere with the behavior of the element, this function will be really useful.

I think this #118 is related

@yojona I use a similar library (dndkit) and solved this issue by disabling autoAnimate while I update the DOM after a dropped drag. It's a little tricky to get right, but it works, and as a nice side-effect, it preserves the "remain" animation when the list order is changing for other reasons.