Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating Panel height can be set larger than displayed height #15

Closed
mhdostal opened this issue Jan 10, 2022 · 1 comment · Fixed by #74
Closed

Floating Panel height can be set larger than displayed height #15

mhdostal opened this issue Jan 10, 2022 · 1 comment · Fixed by #74

Comments

@mhdostal
Copy link
Member

It is possible in the drag code to have the height of the floating panel be larger than the displayed height. This results in a delay when dragging up (making the floating panel smaller) until the calculated height is <= the displayed height.

See the comment here.

Code:

    var drag: some Gesture {
        DragGesture(minimumDistance: 0)
            .onChanged { value in
                handleColor = .activeHandleColor
                // Note:  There is a bug here where `height` can be set
                // larger than the displayed height.  This occurs by continuing
                // to drag down on the handle after the panel reaches it's max
                // height.  When that happens subsequent "drag up" operations
                // don't cause the panel to shrink immediately, but will
                // ultimately snap to the correct height.
                height = max(.minHeight, (height ?? 0) + value.translation.height)
            }
            .onEnded { _ in
                handleColor = .defaultHandleColor
            }
    }
@dfeinzimer dfeinzimer linked a pull request Jul 15, 2022 that will close this issue
@dfeinzimer
Copy link
Collaborator

Resolved via #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants