Menu List Error

Hi, I'm trying to have a menu at the trailing edge of a list but when I do so I am getting UIKit errors. I pasted my sample code below. Not exactly sure how to fix this.

                    ForEach(0..<100) { i in
                        HStack {
                            Text("\(i)")
                            Spacer()
                            Menu {
                                Text("Test")
                            } label: {
                                Image(systemName: "ellipsis")
                            }
                        }
                    }
                }

Adding '_UIReparentingView' as a subview of UIHostingController.view is not supported and may result in a broken view hierarchy. Add your view above UIHostingController.view in a common superview or insert it into your SwiftUI content in a UIViewRepresentable instead.

I ended up being able to get rid of the error. By creating the menu in UIKit and wrapping it to SwiftUI, the warning and visual error went away. Still not an ideal fix though.

That seems like it could be a bug in SwiftUI. Please file an bug report using Feedback Assistant and inlcude a sample project that reproducses the issue. Once you file the request, please post the FB number here. If you're not familiar with how to file bug report, take a look at Bug Reporting: How and Why?

Menu List Error
 
 
Q