Consider the following SwiftUI View:
struct ContentView: View {
@State private var selectedDate = Date()
var body: some View {
List {
Section(header: Text("TextView and DatePicker")) {
VStack {
Text("TextView")
DatePicker(selection: $selectedDate, displayedComponents: .date) {
Text("DatePicker")
}
}
}
}
.listStyle(.sidebar)
}
}
With the sidebar list style, I should be able to collapse and expand list sections. This works in iOS 14. However in iOS 15 the section initially renders okay, but after collapsing and expanding it, nothing gets rendered in the section.
The problem seems very specific to having both Text and DatePicker views inside the section. Any other combinations seem to work okay.
Am I doing something wrong here? Or is there a bug in iOS 15? Are there any workarounds if I need to render this?
2
0
620