Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Sources/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Copy link
Owner

@scenee scenee Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! The current code implicitly assumes that the scrollView is a subview of the surfaceView. This update makes the implementation more flexible. Could you also update scrollView.frame.contains(initialLocation) on line 837 to match this change? It might be worth adding a computed property for this.

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
Expand Down Expand Up @@ -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)

Expand Down