I'm trying to mask a view displayed inside of the widget to a shape that matches the overall shape on iPadOS 15. If I use it as a .clipShape for my subviews. Here is a simplified example showing what I'm doing. On iPadOS 15, this results in a blue rectangle, rather than a blue round rect as I was hoping for. (The exact same code works fine on iOS 15, and macOS Monterey).
struct InsetView: View {
var body: some View {
VStack {
Text("Top")
Text("Bottom")
}
.frame(maxWidth:.infinity, maxHeight: .infinity)
.background(Color.blue)
.padding(10)
.clipShape(ContainerRelativeShape())
}
}
Is this expected behavior, a bug or am I just using this API incorrectly? Any pointers would be great appreciated.
Again this is an issue I'm only seeing on iPadOS 15 (betas 1-5, i.e. all betas so far), it works absolutely fine on iOS 15 beta, and macOS Monterey beta.