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

Unable to scroll Up to transition to big header #56

Open
anthony1810 opened this issue Jun 12, 2024 · 2 comments
Open

Unable to scroll Up to transition to big header #56

anthony1810 opened this issue Jun 12, 2024 · 2 comments

Comments

@anthony1810
Copy link

anthony1810 commented Jun 12, 2024

Please have a look at this video

Basically, when I scroll to the bottom to transition the big header to the small one, and then try to scroll up to the point where there should be a transition between the small header and the big one, the scroll view offset consistently resets and prevents that from happening.

When I try to scroll hard and fast, it can then pass that transition point and expand the header. When I scroll down to the bottom of the screen, this happens again.

OS: iOS 17
Device: Only happen on iPad
ScalingHeaderScrollView: 1.1.3

ScalingHeaderScrollView {
    fullHeaderView
} content: {
    contentView
        .frame(minHeight: UIScreen.main.bounds.height - viewModel.headerCollapseHeight(isIpad: UIDevice.isIpad))
}
.collapseProgress($headerTransitionProgress)
.height(
    min: viewModel.headerCollapseHeight(isIpad: UIDevice.isIpad),
    max: viewModel.headerHeight(isIpad: UIDevice.isIpad)
)
.scrollToTop(resetScroll: $scrollContentToTop)
.pullToRefresh(isLoading: $isRefresh) {
    Task {
        try? await viewModel.reload()
        isRefresh = false
    }
}
.ignoresSafeArea()
.background(Color.backgroundLight.ignoresSafeArea())
@f3dm76
Copy link
Collaborator

f3dm76 commented Jun 17, 2024

Hey @anthony1810, here is the code I tried on ipad ios 17, replacing everything which doesn't compile:

struct ContentView: View {

    var body: some View {
        ScalingHeaderScrollView {
            Color.red
        } content: {
            Color.blue
                .frame(minHeight: UIScreen.main.bounds.height - 100)
        }
        .height(
            min: 100,
            max: 300
        )
        .ignoresSafeArea()
    }
}

works as expected:
https://github.com/exyte/ScalingHeaderScrollView/assets/9447630/55f8e9b0-34e5-45db-b077-53344bf4892d

Please attach a minimal compilable example and make sure the issue reproduces on this minimal example. Have a nice day

@Leonif
Copy link

Leonif commented Jul 17, 2024

I cannot understand is it bug or feature, but I cannot manage to collapse header at once without offset under header

 ScalingHeaderScrollView {
                Color.clear.border(.red, width: 2)
            } content: {
                Color.blue
                    .frame(minHeight: UIScreen.main.bounds.height - 100)
            }
            .height(
                min: 100,
                max: 300
            )
CleanShot.2024-07-17.at.14.54.07.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

3 participants