Initially, I had a property with the @State wrapper to define whether or not a DisclosureGroup is expanded. When expanded, the numbers have a nice animation where they appear one by one (this does not show on the Canvas, it has to be run on a sim or device).
struct ExampleView: View {
@State var isExpanded = false
var body: some View {
DisclosureGroup(isExpanded: $isExpanded) {
ForEach(1..<10) { num in
Text("\(num)")
}
} label: {
Text("Example")
.foregroundColor(.black)
}
}
}
When I replaced @State for @AppStorage("isExpanded")
I expected the behavior to be the same, but when expanding I got shown all numbers at once, while the title of the DisclosureGroup was still moving up.
Is this expected? Should I file a bug report?