Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popmotion pose holds on to and animates orphan DOM elements #318

Closed
aholachek opened this issue May 4, 2018 · 2 comments
Closed

Popmotion pose holds on to and animates orphan DOM elements #318

aholachek opened this issue May 4, 2018 · 2 comments
Labels
Pose is deprecated React Pose users can upgrade to Framer Motion: https://framer.com/motion

Comments

@aholachek
Copy link

aholachek commented May 4, 2018

Hi, I used react-pose for an animation demo and came across these problems:

  1. Shuffling children leads to an out-of-order staggered exit transition for children
  2. Specifying a "preEnterPose" removes the children's staggered enter animations completely.
  3. The "preEnterPose" is only active the first time the parent element is animated in.
  4. Most seriously, when re-animating the parent element in, DOM elements that do not correspond to anything in the props array are animated in (there should only be 8 cards in this image):

screen shot 2018-05-04 at 8 24 43 am

You should be able to reproduce by checking out the demo posted above, and my code is here

In case it's helpful, an example demonstrating expected behavior is here

Hopefully these issues are a result of my own user error, if so, sorry for making an issue!

@mattgperry
Copy link
Collaborator

mattgperry commented May 6, 2018

Thanks for the detailed explanation and code example!

  1. Know what's the cause and made a ticket here: Reorder Pose children #319
  2. Did you try setting a state on the children items with the same "preEnterPose"?
  3. I think this is by design? It's like ReactTransitionGroup's appear state - a way of setting an animation when the PoseGroup first appears rather than subsequent entries. Could probbly communicate this better, unless you mean something else.
  4. Old DOM items are kept in PoseGroup #320

@aholachek
Copy link
Author

  1. I added a preEnterPose to the child PoseGroup and it is working exactly as expected. I guess I thought in this case the children would default to using the exit pose to preload values if no preEnterPose was specified.
  2. You're right, it's totally working correctly.

Thanks for making this library, btw, it's really cool how it's both powerful and user-friendly.

@mattgperry mattgperry added the Pose is deprecated React Pose users can upgrade to Framer Motion: https://framer.com/motion label Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pose is deprecated React Pose users can upgrade to Framer Motion: https://framer.com/motion
Projects
None yet
Development

No branches or pull requests

2 participants