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

Main content appear when scroll begin #162

Open
bfrolicher opened this issue May 30, 2024 · 0 comments
Open

Main content appear when scroll begin #162

bfrolicher opened this issue May 30, 2024 · 0 comments

Comments

@bfrolicher
Copy link

bfrolicher commented May 30, 2024

Describe the bug
MainContent appear during scroll

Minimal reproduce-able code

struct ContentView: View {
    
    @State private var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 51.507222, longitude: -0.1275), span: MKCoordinateSpan(latitudeDelta: 0.5, longitudeDelta: 0.5))
    @State var bottomSheetPosition: BottomSheetPosition = .absoluteBottom(300) //1
    
    var body: some View {
        map()
            .ignoresSafeArea()
            .bottomSheet(bottomSheetPosition: $bottomSheetPosition,
                         switchablePositions: [.dynamicTop, .absoluteBottom(300)],
                         headerContent: header,
                         mainContent: list)
            .dragIndicatorColor(Color.gray)
            .customBackground(Color.white.cornerRadius(20))
    }
    
    func header() -> some View {
        Text("Head")
            .font(.title3)
            .frame(height: 50)
            .frame(maxWidth: .infinity)
            .background(Color.red)
    }
    
    func map() -> some View {
        Map(coordinateRegion: $region)
    }
    
    func list() -> some View {
            List(0..<200) { item in
                Text("Item \(item)")
            }
            .listStyle(.plain)
    }
}

Expected behavior
Main content should be visible on initial state.

Screenshots

RPReplay_Final1717088953.MP4
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

No branches or pull requests

1 participant