Skip to content

Commit

Permalink
Fix a scroll tracking issue of WKWebView on iOS 17.4
Browse files Browse the repository at this point in the history
  • Loading branch information
scenee committed May 15, 2024
1 parent 8f2be39 commit 6d2b08d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,11 @@ class Core: NSObject, UIGestureRecognizerDelegate {
// When no scrollView, nothing to handle.
guard let scrollView = scrollView, scrollView.frame.contains(initialLocation) else { return false }

// For _UISwipeActionPanGestureRecognizer
if let scrollGestureRecognizers = scrollView.gestureRecognizers {
// To prevent moving a panel on swipe actions using _UISwipeActionPanGestureRecognizer.
// [Warning] Don't apply this for WKWebView. WKWebView has another pan gesture in addition
// to UIScrollViewPanGestureRecognizer since iOS 17.4. As a result, this blocks panel moves.
if let scrollGestureRecognizers = scrollView.gestureRecognizers,
scrollView is UITableView || scrollView is UICollectionView {
for gesture in scrollGestureRecognizers {
guard gesture.state == .began || gesture.state == .changed
else { continue }
Expand Down

0 comments on commit 6d2b08d

Please sign in to comment.