I'm running into a problem with using a DisclosureGroup on the Mac using Xcode 15/Sonoma 14.0. In the code below, if I set useDisclosureGroup to TRUE then the window in which SomeDetail is embedded will grow in vertical size and have its minimum vertical size changed to the new height of the window (so that it can't be shrunk vertically). If I set useDisclosureGroup to FALSE then everything works normally. The problem seems to be triggered by the lines demarcated by BUG/ENDBUG. If those lines are replaced by a simple Text view then the problem doesn't manifest.
Thoughts?
@ObservedObject var foo: Foo
@State private var now: Date? = Date.now
@State private var isSummaryExpanded: Bool = true
private let useDisclosureGroup = false
var body: some View {
VStack(alignment: .leading) {
if useDisclosureGroup {
DisclosureGroup("Summary", isExpanded: $isSummaryExpanded) {
HStack {
VStack(alignment: .leading) {
// BUG?
if let latestDate = now {
Text("Latest update: \(latestDate.description)")
} else {
Text("Latest update: --")
}
// ENDBUG
Text("placeholder")
}
Spacer()
}
}
}
else {
Section {
HStack {
VStack(alignment: .leading) {
if let latestDate = now {
Text("Latest update: \(latestDate.description)")
} else {
Text("Latest update: --")
}
Text("placeholder")
}
Spacer()
}
}
}
Spacer()
}
}
}