Animations won't animate in a lazy container
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 330
- Forks
- 76
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 1
Description
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Sources/Showcase/TransitionPlayground.swift at lines 48-59, change the HStack to LazyHStack, launch the app, and reproduce the issue by clicking the grey box or the withAnimation button. Done means the red dots animate when count changes, or a clear error appears in the logs explaining the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100