diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift index 25dee18d..889d3a3a 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift @@ -728,6 +728,15 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, let newContentOffset = change?[.newKey] as? CGPoint let oldContentOffset = change?[.oldKey] as? CGPoint let startedByUser = scrollView.isDragging || scrollView.isDecelerating + // zpdl9089 : https://github.com/pichillilorenzo/flutter_inappwebview/issues/1947 + if #available(iOS 17.2, *) { + if let y = newContentOffset?.y { + if(!startedByUser && scrollView.contentInset.bottom < 0.0 && y <= scrollView.contentInset.bottom) { + scrollView.contentOffset = oldContentOffset ?? .zero + return + } + } + } if newContentOffset != oldContentOffset { DispatchQueue.main.async { self.onScrollChanged(startedByUser: startedByUser, oldContentOffset: oldContentOffset)