diff --git a/Sources/Core.swift b/Sources/Core.swift index 659ca72c..a8aa8a2b 100644 --- a/Sources/Core.swift +++ b/Sources/Core.swift @@ -625,7 +625,12 @@ class Core: NSObject, UIGestureRecognizerDelegate { private func shouldScrollViewHandleTouch(_ scrollView: UIScrollView?, point: CGPoint, velocity: CGFloat) -> Bool { // When no scrollView, nothing to handle. - guard let scrollView = scrollView, scrollView.frame.contains(initialLocation) else { return false } + guard let scrollView = scrollView else { return false } + let scrollViewFrame = surfaceView.convert( + scrollView.frame, + from: scrollView.superview + ) + guard scrollViewFrame.contains(initialLocation) else { return false } // Prevents moving a panel on swipe actions using _UISwipeActionPanGestureRecognizer. // [Warning] Do not apply this to WKWebView. Since iOS 17.4, WKWebView has an additional pan @@ -731,7 +736,9 @@ class Core: NSObject, UIGestureRecognizerDelegate { if surfaceView.grabberAreaContains(initialLocation) { return false } - if let sv = scrollView, sv.panGestureRecognizer.state == .changed { + if let sv = scrollView, ( + sv.panGestureRecognizer.state == .changed || sv.panGestureRecognizer.state == .began + ) { let (contentSize, bounds, alwaysBounceHorizontal, alwaysBounceVertical) = (sv.contentSize, sv.bounds, sv.alwaysBounceHorizontal, sv.alwaysBounceVertical)