Popovers icon indicating copy to clipboard operation
Popovers copied to clipboard

Popover doesn't position properly

Open rampatra opened this issue 1 year ago • 2 comments

CleanShot 2023-03-04 at 19 13 58@2x

In the picture attached, I have attached the popover to the last box in the grid and still the popover opens up a bit left of the source view and not directly under it. In other words, I want to get rid of the space shown by the arrow in the screenshot. Any ideas?

This is the code I am using:

.popover(present: $popoverShown) {
    VStack {
        Text("This is a pretty standard-looking popover with an arrow.")
            .foregroundColor(.primary)
            .onTapGesture {
                print("ok")
            }
    }
    .padding()
    .background(.background)
    .cornerRadius(12)
    .shadow(radius: 1)
    .frame(maxWidth: 150)
}

rampatra avatar Mar 04 '23 19:03 rampatra