Skip to content

Animations won't animate in a lazy container #219

@dfabulich

Description

@dfabulich

https://github.com/skiptools/skipapp-showcase/blob/1a788a2f1e3cf727ba07ac6050eb1611ed7ad633/Sources/Showcase/TransitionPlayground.swift#L48-L59

Text("HStack.animation")
Spacer()
HStack {
    ForEach(0..<count, id: \.self) { i in
        Color.red
            .frame(width: 20, height: 20)
            .id(i + 1)
    }
}
.frame(width: 100, height: 100)
.background(.gray)
.animation(.default, value: count)

Change this HStack into a LazyHStack. Launch the app and click on the grey box or the withAnimation button

Actual: The red dots appear/disappear instantly without animation.

Expected: Changing the HStack into a LazyHStack should have no effect on the animation, or, if it does, there should be an error message somewhere (in the logs, at the very least).

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