Skip to content

Keys not working, element loses css transition #9501

Closed
@santiagopuentep

Description

@santiagopuentep

If I swap the position of two react elements (item0 and item1) positioned with transform: translate(); a css transition is triggered, only if the elements were rendered in the same order.

If I change the order of the render (position swap still the same but now item0 renders after item1), the css transition is not triggered.

It looks like react is deleting the DOM element and recreating it, even if they have React keys set and no componentDidMount/componentWillUnmount are called.

Here is a simple JSfiddle with the problem.

https://jsfiddle.net/santiagopuentep/vvpezbp9/2/

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