Reputation: 1467
Why does list editing via the EditButton
break after tapping "Change List ID"? The controls to delete list items do not appear.
Steps to reproduce:
import SwiftUI
struct ContentView: View {
@State var listID = UUID()
var body: some View {
Button("Change List ID", action: {
withAnimation {
listID = UUID()
}
})
EditButton().padding(.top)
List {
ForEach(1..<4) {
Text("Item \($0)")
}.onDelete(perform: {_ in })
}
.id(listID)
.transition(.slide)
}
}
I would like to animate changing lists. I have tried a TabView with .tabViewStyle(.page)
but it breaks swipe actions on list rows.
Related question: SwiftUI Edit Button not working after animation
Upvotes: 0
Views: 141