lucaszischka / BottomSheet

A sliding Sheet from the bottom of the Screen with 3 States build with SwiftUI.
MIT License
1.03k stars 138 forks source link

When TabView is present, tab items are displayed over the bottom sheet #146

Closed uliashkevich closed 9 months ago

uliashkevich commented 10 months ago

Describe the bug When TabView is a parent of the view containing bottom sheet, tab items are displayed over the bottom sheet.

Minimal reproduce-able code Use this preview code in BottomSheetTests project:

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        @State var selectedTab = 0
        TabView(selection: $selectedTab) {
            ContentView()
                .tabItem {
                    Image(systemName: "person")
                    Text("Profile")
                }.tag(0)
        }
    }
}

Expected behavior Bottom sheet should be always displayed on top of all the UI elements.

Screenshots

Screenshot 2023-10-29 at 3 25 46 PM

Target version

lucaszischka commented 9 months ago

Hello @uliashkevich, @SpectralDragon, this is expected behaviour; if you want to display it above the TabView, you will have to move it up in the SwiftUI View Hierarchy see #60.