I have a ProgressView in a Form, that's being toggled on and off. The first time it shows correctly, subsequently it does not. Outside of a Form it works correctly.
Here's the sample code:
struct BugWithProgress: View {
@State var toggle: Bool = false
var body: some View {
Text("in form:").font(.title)
Form {
Toggle(isOn: $toggle, label: {
Text("isOn: \(toggle)")
})
if toggle {
HStack {
ProgressView()
Spacer()
ProgressView("Working...")
Spacer()
Text("Working...")
}
}
}
.frame(height: 200)
Text("outside form:").font(.title)
if toggle {
HStack {
ProgressView()
Spacer()
ProgressView("Working...")
Spacer()
Text("Working...")
}
}
}
}
#Preview {
BugWithProgress()
}
If I toggle it on once, it looks as expected. Here's what it looks like after I toggled it on twice or more:
As you can see, the spinning parts are missing within the Form.
Any suggestions or workarounds?
PS: Is this the correct place for SwiftUI bug reports?