Bug in SwiftUI List view

In the following code, click/touch anywhere on any row of the list deletes that row. This is not expected. Only the click/touch on the "xmark" button should delete that row.

import SwiftUI

struct MainView: View {
    private let arr: [String] = ["one", "two", "three"]
    var body: some View {
        List(arr, id: \.self) {item in
            SecView(name: item)
        }
        
    }
}

struct SecView: View {
    var name: String
    @State private var show = true
    
    var body: some View {
        if show {
            HStack {
                Text(name)
                Button(action: {
                    show = false
                }, label: {
                    Image(systemName: "xmark")
                })
                .border(.yellow)
            }
        }
    }
}

@main
struct XApp: App {
    var body: some Scene {
        WindowGroup {
            MainView()
        }
    }
}

Please check. I ran the above code for iPAD air (5th generation).

I can reproduce the behavior.

The following Stack Overflow question has a workaround:

https://stackoverflow.com/questions/56561064/swiftui-multiple-buttons-in-a-list-row

You can file a bug report with Apple on this by choosing Help > Report an Issue in Xcode.

Bug in SwiftUI List view
 
 
Q