When using Section(_:isExpanded:) inside a List with .listStyle(.sidebar) in a NavigationSplitView, some rows don't animate with the others during collapse and expand. Specific rows (often in the middle of the section) snap in/out instantly while the rest animate smoothly.
I've reproduced this with both static views and ForEach.
Minimal reproduction:
struct SidebarView: View {
@State private var sectionExpanded = true
@State private var selection: Int?
var body: some View {
NavigationSplitView {
List(selection: $selection) {
Section("Section", isExpanded: $sectionExpanded) {
ForEach(1...3, id: \.self) { index in
NavigationLink(value: index) {
Label("Item \(index)", systemImage: "\(index).circle")
}
}
}
}
.listStyle(.sidebar)
.navigationTitle("Sidebar")
} detail: {
if let selection {
Text("Selected item \(selection)")
} else {
Text("Select an item")
}
}
}
}
Environment: macOS 26.3, Xcode 26.3, SwiftUI
Steps to reproduce:
- Run the above code in a macOS app
- Click the section disclosure chevron to collapse
- Observe that some rows animate out while others snap instantly
- Expand again — same inconsistency
Expected: All rows animate together uniformly.
Actual: Some rows (typically middle items) skip the animation entirely.
I also tried using static Label views instead of ForEach, same result. Is there a known workaround?