SwiftUI crash when using wheel style Picker in form in form

I'm using a wheel style picker in a form that I navigate to using a NavigationLink. When I rotate the wheel, the app crashes. If I remove the form in SubForm, the crash disappears, but then the looks are completely different. I'd like the looks of the form, but obviously I don't want the crash. Any suggestions? (iOS15 in a simulator using Xcode 13)

struct SubForm: View {
    @State private var selection = 1
    
    var body: some View {
        Form {
            Section(header: Text("Another title")) {
                Picker("Pick me", selection: $selection) {
                    Text("First item").tag(0)
                    Text("Second item").tag(1)
                }.pickerStyle(.wheel)
            }
        }
    }
}

struct ContentView: View {
    var body: some View {
        NavigationView {
            Form {
                Section(header: Text("A title")) {
                    NavigationLink("Subview", destination: { SubForm() })
                }
            }
        }
    }
}
Answered by Ronvtw in 688076022

After struggling with this issue for a day, I find the answer half an hour after posting. The solution is to replace the Form in SubForm with List, and it gives me exactly what I'm looking for.

Accepted Answer

After struggling with this issue for a day, I find the answer half an hour after posting. The solution is to replace the Form in SubForm with List, and it gives me exactly what I'm looking for.

I've been struggling with a similar issue that makes the app crash using either Form or List. In this case I want to conditionally show the picker based on a previous option in the form. It shows the picker, but after a couple of selections in it, it crashes showing no detailed information on the error. It also in IOS15 and Xcode 13, testing directly in an iPhone 12 Pro. Didn't find a solution yet...

SwiftUI crash when using wheel style Picker in form in form
 
 
Q