Skip to content

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

@AleksanderMaj

Description

@AleksanderMaj

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions