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

presentation glitches when using custom detent #67

Open
ohwhen opened this issue Nov 15, 2024 · 1 comment
Open

presentation glitches when using custom detent #67

ohwhen opened this issue Nov 15, 2024 · 1 comment

Comments

@ohwhen
Copy link

ohwhen commented Nov 15, 2024

Have a weird issue where on iOS 17.* the presentation modifier is glitching (animating twice, opening full screen and then dismisses) when using a custom detent, works fine with .medium detent.

/// works
.presentation(transition: .sheet(detents: [.medium]), isPresented: $isPresenting) {
    Text("Test Sheet")
}

/// glitches
.presentation(transition: .sheet(detents: [.constant("checkoutView", height: 420)]), isPresented: $isPresenting) {
    Text("Test Sheet")
}
ios-transmission-sheet_compressed.mp4
@nathantannar4
Copy link
Owner

Could you please share an example that reproduces? And how you are testing: Xcode version, simulator version.

I could not reproduce on Xcode 18.1, iOS 18.1/17.0

struct Issue67: View {
    var body: some View {
        ContentView()
    }

    struct ContentView: View {
        @State var isPresented = false
        var body: some View {
            VStack {
                Button("Present") {
                    withAnimation {
                        isPresented = true
                    }
                }
            }
            .presentation(
                transition: .sheet(
                    detents: [.constant("checkoutView", height: 420)]
                ),
                isPresented: $isPresented
            ) {
                Text("Test Sheet")
            }
        }
    }
}

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