Popovers icon indicating copy to clipboard operation
Popovers copied to clipboard

Popover inside Scrollview not supported?

Open PixelPirate opened this issue 1 year ago • 1 comments

When attaching a popover to a view inside a scrollView, the popover will remain at fixed position when scrolling. It seems to be impossible to let the popover follow the attached view.

Is this a bug or a missing feature?

ScrollView {
    …
    TextField(…)
    .popover(
        present: $focusedTextField,
        attributes: {
            $0.position = .absolute(
                originAnchor: .top,
                popoverAnchor: .bottom
            )
            $0.sourceFrame = { rectOfTextField }
            $0.sourceFrameInset.top = -16
            $0.rubberBandingMode = .none
            $0.dismissal = .init(
                mode: .none,
                dragMovesPopoverOffScreen: false
            )
        }
    ) {
        Templates.Container(…)
    }
}

PixelPirate avatar May 20 '23 13:05 PixelPirate