Skip to content

<transition-group> does not perform FLIP correctly when multiple items are removed in one step #6349

@danielgjackson

Description

@danielgjackson

Version

2.4.2

Reproduction link

https://jsfiddle.net/fqes6q3b/1/

Steps to reproduce

Click the 'Remove three' to remove multiple items in one step.

What is expected?

Removing single items works as expected (items drop vertically).

Removing multiple items should have the same animation as repeated single removals -- but it does not work as expected.

What is actually happening?

When multiple items are removed, the horizontal location of the items shifts to that of the first item removed.


I would guess that the <transition-group> is adjusting each item's class as it goes through the elements, setting it to '-leave'active', which has 'position: absolute' — this takes it out of the flow, so the following element now has the same 'left' position as the previous, so that element's horizontal position has now been affected when the FLIP calculation is made. (This would explain why single element removals work as expected — there are no 'other elements' affected).

If this is correct, this could be fixed, for example, if the <transition-group> accumulated the class adjustments that it would make, and only made them after the FLIP animation calculations were made.

(Edited: the 'new-issue.vuejs.org' tool translates html entities: e.g. &lt; to < for the github issue, which then hides unknown tags.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions