-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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 with flex parent causes removed items to fly #11654
Comments
if i understood correctly , when the element inside the "transition" component is removed , firstly the transition classes will be added to that element. it mentions in the documentation:
|
Yes, I agree that this behaviour is correct as far as documentation is concerned. However, this visually causes the fading elements to jump around as described above. I want to know whether there is a way to get the desired effect (no elements jumping around when transitioning out) using the current Vue version and if not, to bring this to the attention of a developer who knows to/can point me in the direction of adding the necessary feature. |
I believe I bumped into this issue as well today. Have a slightly different scenario: a FABs grid (floating-action-buttons) on the bottom-right of the viewport. Newly added buttons will appear to fly from Codesandbox: https://9kt1h.csb.app/ EDIT: possibly related with #8785 and #7879 and #5800 transition-group-flying-items.mp4 |
I run in to a similar issue. |
Same here. Also using Vue 3.2. Currently using the workaround (#9713 (comment)) |
I think flex and grid layout do not play well with leaving transitions of FLIP animations in general. We are applying an absolute layout for elements which are transitioned out. Elements with |
Hello. I cannot say if I fully grasp the gist of the problem without seeing it run; but I just now encountered a similar problem with flexbox and transitions too. Things were moving due to what was stated above about before-leave and leave. So I came up with an ugly solution—one that, over coffee, I'm wondering if I should stick too. But it allows for me to have a flex container doing its things. So here goes:
Forgive the wrapper namings, will update. Actually, Downside, an abundance of containers. T. |
Version
2.6.11
Reproduction link
https://codepen.io/turboSheep/pen/OJNQGEG
Steps to reproduce
Click the 'Remove Multiple' or 'Remove First 2' buttons and observe the movement of the items.
What is expected?
The rectangles being removed should fade out on the spot.
What is actually happening?
The rectangles fade out and also move to various locations on the canvas.
Observe that if the items 1 and 2 are to be removed, then the events fired in the following order:
This means that
beforeLeave
for the second element is called afterleave
is called for the first element. So whenbeforeLeave
is called for the second element, the first element already hasposition: absolute
. This means that (while the DOM has not yet rendered the change) the position of the second element has moved to be where the first element used to be, meaning thatel.offsetLeft
is now 'incorrect'. The visual effect is that the first two elements both float to the same position.This can be shown clearly by clicking the 'Remove First 2' button.
Similar behaviour has been documented by issue #9713 but the issue was quickly closed in March 2019 with a workaround posted in Jan 2020.
The text was updated successfully, but these errors were encountered: