I used a VStack because I usually associate a List with a homogeneous set of values a.o.t. a VStack which seems to be a more heterogeneous grouping. (I'm still newish to SwiftUI so I try to keep things simple for my own sake.) I tried using a List per your suggestion but retaining the header: and, interestingly, the "toggling" of both isExpanded bools now work but the Section bodies don't collapse. Also, the second Section looks to be "graphically subordinate" with relation to the first Section (i.e. the first Section's header divider is drawn all the way to the left edge of the containing view but the second Section's divider is drawn indented - go figure).
List {
Section(isExpanded: $isExpanded_1) {
Text("Working section")
}
header: {
SummaryHeader(isSummaryExpanded: $isExpanded_1)
}
Section(isExpanded: $isExpanded_2) {
Text("Broken section")
}
header: {
SummaryHeader(isSummaryExpanded: $isExpanded_2)
}
Spacer()
}
FWIW, I want/need to use header: because it contains the disclosure chevron that toggles the isExpanded bool.
FWIW#2, I'm using this instead of a DisclosureGroup because DisclosureGroups seem to have their own set of problems.