SwiftUI Modal View overlaps screen

I have a Modal view that seems to overlap the screen of my iPhoneX.

This is DetailView.swift.

import SwiftUI

struct DetailView : View {
    @Binding
    var shouldDismiss : Bool
   
    var textData : String
    var image : UIImage?

    @Environment(\.isPresented) private var isPresented

    var body: some View {
       
           
        VStack( alignment: .leading) {
           
            Button(action: {
                self.shouldDismiss.toggle()
            }) {
                Text("Close")
            }.font(.title)
                .foregroundColor(Color.secondary)
                .padding()

            Image(uiImage: image ?? UIImage())
                .padding()
            Text(textData)
                .lineLimit(0)
            Spacer()
           
        }
    }
   
}


This is where the view is being pushed:


ZStack {
...
}.presentation(showDetails ? Modal(DetailView(shouldDismiss: $showDetails, textData: theTxtData, image: theImage), onDismiss:{ self.showDetails = false }) : nil)


The DetailView overlaps on both sides of the screen. The text on the close Button is cut off (The "C" is not visible). Same goes for the image and the textData filed.

It's only a bandaid, but I worked around a similar issue on MacOS by padding the Views that were being clipped. In my case, the top 50 or so pixels were being drawn farther up the Y axis than the top edge of the application window. In addition, it may be worthwhile to file a bug on the behavior.

SwiftUI Modal View overlaps screen
 
 
Q