We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 767112f commit c69304cCopy full SHA for c69304c
Sources/Views/HStackSnapCore.swift
@@ -21,6 +21,7 @@ public struct HStackSnapCore<Content: View>: View {
21
self.scrollOffset = leadingOffset
22
self.coordinateSpace = coordinateSpace
23
self.eventHandler = eventHandler
24
+ self._prevScrollOffset = State(initialValue: leadingOffset)
25
}
26
27
// MARK: Public
@@ -153,7 +154,7 @@ public struct HStackSnapCore<Content: View>: View {
153
154
@State private var scrollOffset: CGFloat
155
156
/// Stored offset of previous scroll, so scroll state is resumed between drags.
- @State private var prevScrollOffset: CGFloat = 0
157
+ @State private var prevScrollOffset: CGFloat
158
159
/// Calculated offset based on `SnapLocation`
160
@State private var targetOffset: CGFloat
0 commit comments