Thank you for the response, and sorry for the delay. I filed FB20262535 with a sample project. @j_salling I notice a lot of jumping around or the "bubble" that hosts the menu content will can laid out on the screen in a variety of ways depending on the content around it.
I did find something that may work around this issue, though it's a bit of a hack and I don't know if it would cause other issues itself. The most basic way to experience this is present a UIHostingController with ContentView and have ContentView contain something like the following:
Menu {
Button("Sample action") {}
Button("Other action") {}
} label: {
HStack {
Text("Press ME!")
Image(systemName: "arrowtriangle.down.fill")
}
}
This causes the error log, but since the View is simple, and contains no other elements, it does not cause jumpy animations or oddities. Feel free to decorate this view as much as you want to probably get the animation oddities (header, a scrollable list...).
What's interesting though, is the error does not appear if this menu is wrapped in a ScrollView.
ScrollView {
... // same menu code above
}
.fixedSize()
This prevents the error, and may, prevent view jumping. I'm going to test in my main app to see if the visual glitches are resolved, but may be a work aroundf or the time being if so.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: