File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public struct HStackSnapCore<Content: View>: View {
2121 self . scrollOffset = leadingOffset
2222 self . coordinateSpace = coordinateSpace
2323 self . eventHandler = eventHandler
24+ self . _prevScrollOffset = State ( initialValue: leadingOffset)
2425 }
2526
2627 // MARK: Public
@@ -89,6 +90,7 @@ public struct HStackSnapCore<Content: View>: View {
8990 eventHandler ? ( . didLayout( layoutInfo: itemScrollPositions) )
9091 }
9192 } )
93+ . contentShape ( Rectangle ( ) )
9294 . gesture ( snapDrag)
9395 }
9496 . coordinateSpace ( name: coordinateSpace)
@@ -153,7 +155,7 @@ public struct HStackSnapCore<Content: View>: View {
153155 @State private var scrollOffset : CGFloat
154156
155157 /// Stored offset of previous scroll, so scroll state is resumed between drags.
156- @State private var prevScrollOffset : CGFloat = 0
158+ @State private var prevScrollOffset : CGFloat
157159
158160 /// Calculated offset based on `SnapLocation`
159161 @State private var targetOffset : CGFloat
You can’t perform that action at this time.
0 commit comments