Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,34 @@ struct ForEachUITests {
}
openSwiftUIAssertSnapshot(of: ContentView())
}

@Test(
.bug(
"https://github.com/OpenSwiftUIProject/OpenSwiftUI/issues/655",
id: 655
)
)
func transitionAnimation() {
struct ContentView: AnimationTestView {
nonisolated static var model: AnimationTestModel {
AnimationTestModel(duration: 2.0, count: 4)
}
@State private var items = [6]

var body: some View {
VStack(spacing: 10) {
ForEach(items, id: \.self) { item in
Color.blue.opacity(Double(item) / 6.0)
.frame(height: 50)
.transition(.slide)
}
}
.animation(.easeInOut(duration: Self.model.duration), value: items)
.onAppear {
items.removeAll { $0 == 6 }
}
}
}
openSwiftUIAssertAnimationSnapshot(of: ContentView())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public struct MoveTransition: Transition {
}

public func _makeContentTransition(transition: inout _Transition_ContentTransition) {
guard case let .effects(style, size) = transition.operation else {
guard case let .effects(_, size) = transition.operation else {
transition.result = .bool(true)
return
}
let effectiveSize = edge.translationOffset(for: size)
let effectiveSize = edge.translationOffset(for: size)
let effect = ContentTransition.Effect(.translation(effectiveSize))
transition.result = .effects([effect])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ struct DynamicLayoutViewAdaptor: DynamicContainerAdaptor {
var containerID = DynamicContainerID(uniqueId: uniqueId, viewIndex: 0)
let outputs = item.elements.makeAllElements(inputs: inputs) { elementInputs, body in
var elementInputs = elementInputs
containerInputs(&elementInputs)
if elementInputs.needsGeometry {
let childGeometry = Attribute(
DynamicLayoutViewChildGeometry(
Expand Down
Loading