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

[Maps-SwiftUI] FloatingPanelView.Content displayed above FloatingPanelView.FloatingPanelContent #536

Closed
AleksanderMaj opened this issue Mar 30, 2022 · 1 comment · Fixed by #556

Comments

@AleksanderMaj
Copy link

AleksanderMaj commented Mar 30, 2022

Description

This concerns the Maps-SwiftUI proof of concept. If I replace the Map view with a VStack containing 3 labels, some of these labels appear above the floating panel (see pics)
Simulator Screen Shot - iPhone 11 - 2022-03-30 at 14 45 15 Simulator Screen Shot - iPhone 11 - 2022-03-30 at 14 45 19

Expected behavior

The FloatingPanelView.content view should be completely behind the floating panel.

Actual behavior

Some children of the FloatingPanelView.content appear on top of the floating panel

Steps to reproduce

Code example that reproduces the issue
In Maps-SwiftUI/Maps/ContentView.swift

struct ContentView: View {
// ...
    var body: some View {
        ZStack {
// Replace this:
//            Map(coordinateRegion: $region)
//                .ignoresSafeArea()

// With this:
            VStack {
                Text("Why is this visible?")
                Text("Why is this visible?")
                Text("Why is this visible?")
            }
            statusBarBlur
        }
    }
}

How do you display panel(s)?

  • Add as child view controllers

How many panels do you display?

  • 1

Environment

Library version
2.5.2

Installation method
Swift Package Manager

iOS version(s)
15.4

Xcode version
13.3

Possible fix

I noticed that changing the following line in FloatingPanelView.Coordinator.setupFloatingPanel(_:UIViewController) fixes the problem:

// Change this:
//          fpc.addPanel(toParent: parentViewController, at: 1, animated: false)
// to this:
            fpc.addPanel(toParent: parentViewController, animated: false)

I'm not familiar with this component well-enough to know that it's an acceptable fix

@scenee
Copy link
Owner

scenee commented Apr 2, 2022

Thank you for your report!

I'm not familiar with this component well-enough to know that it's an acceptable fix

I agree with you. The fix looks good.

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