[webview_flutter] Register the iOS platform view with the hit-test gesture blocking policy - #12495
[webview_flutter] Register the iOS platform view with the hit-test gesture blocking policy#12495burakimdatt wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates WebViewFlutterPlugin.swift on iOS to register the web view factory using the FlutterPlatformViewGestureRecognizersBlockingPolicyDoNotBlockGesture policy. A corresponding unit test has been added to FWFWebViewFlutterWKWebViewExternalAPITests.swift to verify this policy registration, and the package version is bumped to 3.26.1 in pubspec.yaml and CHANGELOG.md. There are no review comments, so there is no feedback to provide.
…sture policy The default eager policy blocks the platform view's gesture recognizers through Flutter's stateful gesture arena. When that state is stranded the web view stops receiving touches for the rest of its lifetime, which reproduces on iOS 26 where the engine's stuck-state reset is disabled. The doNotBlockGesture policy derives the same blocking decision from hit testing, so there is no recognizer state left to strand.
939baac to
e28f33a
Compare
|
Closing this — I opened it from the wrong account. Reopening from the GitHub account associated with my signed CLA. Sorry for the noise. |
Registers the iOS platform view with
FlutterPlatformViewGestureRecognizersBlockingPolicyDoNotBlockGestureinstead of relying on the defaulteagerpolicy.eagerblocks the platform view's gesture recognizers through Flutter's gesture arena, which is stateful. If that state is stranded the web view stops receiving touches for the rest of its lifetime. The engine used to recover from this inForwardingGestureRecognizer.forceResetStateIfNeeded, but that reset returns early on iOS 26 and above (see flutter/flutter#179907), so on iOS 26 there is nothing left to recover it.doNotBlockGesturederives the same blocking decision fromhitTestrather than the arena, and does not install the delaying recognizer at all — so there is no recognizer state to strand. Blocking behaviour itself is preserved:FlutterTouchInterceptingView.hitTeststill consultsplatformViewShouldAcceptTouchAtTouchBeganLocation:and returns itself when a Flutter widget is on top, and the forwarding recognizer is still installed so Flutter's arena keeps seeing the touches.Verified on iOS 26.3 simulator, iOS 26.4 simulator and an iOS 26.6 device: the web view is unresponsive after the first interaction without this change, and behaves correctly with it.
Fixes flutter/flutter#191261
Open question for the reviewer: this change is unconditional rather than gated behind
if #available(iOS 26.0, *). I went that way because it is not iOS-26-specific in principle — the arena state can be stranded on any version, iOS 26 just removed the net that used to hide it — and because it matches the direction described in flutter/flutter#175099 ("help prevent regressions even if this WebKit bug happens again"). Happy to add a version gate instead if you would rather keep the blast radius smaller.Pre-Review Checklist
[shared_preferences]///).