I have two buttons defined inside a Form. Pressing either one activates both. This doesn’t happen if I remove the Form or the HStack. I opened a Feedback for this, but haven’t gotten a response yet. I haven’t been able to find a workaround for this while keeping the Form and the HStack.
Any thoughts?
import SwiftUI
struct ContentView: View
{
var body: some View
{
Form
{
HStack
{
Button("Button 1")
{ let _ = print("Button 1 tapped") }
Button("Button 2")
{ let _ = print("Button 2 tapped") }
}
}
}
}