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

Transition group gravity #262

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eli-crow
Copy link

@eli-crow eli-crow commented Feb 4, 2021

Summary

Add a gravity prop to <transition-group> to prevent unintuitive "jumping" before -move transitions in lists whose items stack to the right or bottom. The prop would change the point on the ClientRect used to measure how far the item has moved. This is most salient when the child element changes in size.

Links

@posva
Copy link
Member

posva commented Feb 7, 2021

I would say something along the lines of origin for the prop instead of gravity would make more sense given the possible values

@eli-crow
Copy link
Author

eli-crow commented Feb 8, 2021

I'm not opposed to that. I wonder, though, if that might be confused for transform-origin. Perhaps something more specific like position-origin or position-anchor?

Some other ideas:

  • keep gravity, but use up, down, left and right instead of top, bottom, left, and right to imply motion and not measurement
  • Or focus on behavior and call it something like stable-point
  • direction

@Justineo
Copy link
Member

Justineo commented Feb 9, 2021

I would say something along the lines of origin for the prop instead of gravity would make more sense given the possible values

I made a PR for Vue 2 before which added an origin prop for <transition-group> but for a different use case. See vuejs/vue#8424 and vuejs/vue#9430. I saw Evan marked that PR as a todo for v2.7 (it has been a long time so I’m not sure if it’s still the plan). Maybe we need more input for prop names for both use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants