Skip to content

Commit

Permalink
Fix dragging on content placed above the trackedView resets scroll po…
Browse files Browse the repository at this point in the history
…sition (#527)

Changed how `initialScrollOffset` is set. This issue was described in #526.
  • Loading branch information
dudek-j authored Feb 4, 2022
1 parent e39f634 commit 6e7c311
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ class Core: NSObject, UIGestureRecognizerDelegate {
if stopScrollDeceleration {
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }

self.stopScrolling(at: self.initialScrollOffset)
}
}
Expand Down Expand Up @@ -801,7 +801,7 @@ class Core: NSObject, UIGestureRecognizerDelegate {
if grabberAreaFrame.contains(location) {
initialScrollOffset = scrollView.contentOffset
} else {
initialScrollOffset = contentOffsetForPinning(of: scrollView)
initialScrollOffset = scrollView.contentOffset
let offsetDiff = scrollView.contentOffset - contentOffsetForPinning(of: scrollView)
switch layoutAdapter.position {
case .top, .left:
Expand Down

0 comments on commit 6e7c311

Please sign in to comment.