danielsaidi / ScrollKit

ScrollKit is a SwiftUI SDK that adds powerful scroll features, like offset tracking and a header view that stretches & transforms as you pull down, and sticks to the top when you scroll.
MIT License
722 stars 26 forks source link

ScrollViewWithStickyHeader doesn't pass 'showsIndicators' to ScrollViewWithOffsetTracking #13

Closed im-murilo closed 5 months ago

im-murilo commented 7 months ago

When setting a ScrollViewWithStickyHeader's 'showsIndicators' to 'false', this value is not passed on to ScrollViewWithOffsetTracking, so it always defaults to showing indicators.

Current version: var scrollView: some View { GeometryReader { proxy in ScrollViewWithOffsetTracking(onScroll: handleScrollOffset) { VStack(spacing: 0) { scrollHeader content() .frame(maxHeight: .infinity) } } .onAppear { DispatchQueue.main.async { navigationBarHeight = proxy.safeAreaInsets.top } } } }

Should be: var scrollView: some View { GeometryReader { proxy in ScrollViewWithOffsetTracking(onScroll: handleScrollOffset, showsIndicators: showsIndicators) { VStack(spacing: 0) { scrollHeader content() .frame(maxHeight: .infinity) } } .onAppear { DispatchQueue.main.async { navigationBarHeight = proxy.safeAreaInsets.top } } } }

danielsaidi commented 5 months ago

Thanks to you, now they do! 🙌

This is out in the just released 0.5.1.