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

Simple partialSheet with type .scrollView doesn't work #180

Open
nashfive opened this issue Oct 5, 2023 · 1 comment
Open

Simple partialSheet with type .scrollView doesn't work #180

nashfive opened this issue Oct 5, 2023 · 1 comment

Comments

@nashfive
Copy link

nashfive commented Oct 5, 2023

I am trying a very simple dummy project to add a Scrollview in the sheet by using the PSType.scrollView as showed in the examples, but it doesn't work and even shows a UI glitch at the bottom of the sheet content while dragging.

Here is a simple app to demonstrate the issue:

import PartialSheet
import SwiftUI

@main struct PartialSheetTestsApp: App {
    var body: some Scene {
        WindowGroup {
            NavigationView { ContentView() }
                .navigationViewStyle(.stack)
                .attachPartialSheetToRoot()
        }
    }
}

struct ContentView: View {
    @State var show = false
    let type = PSType.scrollView(height: 200, showsIndicators: true)

    var body: some View {
        Button("show") { show.toggle() }
            .partialSheet(isPresented: $show, type: type, content: SheetContent.init)
    }
}

struct SheetContent: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 20) {
            HStack {
                Spacer()
                Text("Privacy Policy").font(.headline)
                Spacer()
            }
            Text("Vestibulum iaculis sagittis sem, vel hendrerit ex.").font(.body).lineLimit(2)
            Divider()
            Text("""
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vestibulum porttitor ligula quis faucibus. Maecenas auctor tincidunt maximus. Donec lectus dui, fermentum sed orci gravida, porttitor porta dui.
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vestibulum porttitor ligula quis faucibus. Maecenas auctor tincidunt maximus. Donec lectus dui, fermentum sed orci gravida, porttitor porta dui.
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vestibulum porttitor ligula quis faucibus. Maecenas auctor tincidunt maximus. Donec lectus dui, fermentum sed orci gravida, porttitor porta dui.
            """)
            Spacer().frame(height: 50)
        }
        .padding(.horizontal, 10)
    }
}

#Preview {
    NavigationView { ContentView() }.attachPartialSheetToRoot()
}

Live demo:
https://github.com/AndreaMiotto/PartialSheet/assets/50933/4d0f6b84-bdf8-4f04-9c64-292465539021

Xcode 15, PartialSheet 3.1.1
Same result on Preview, simulators and devices...

@nick-tw
Copy link

nick-tw commented Feb 21, 2024

It seems that the scrollview example in the repo doesn't work either. iOS 17 broke it possibly.

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

2 participants