You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d8b4304
Browse filesBrowse the repository at this point in the historyBrowse files
[webview_flutter] Add gesture blocking policy to WebKitWebViewWidgetCreationParams (flutter#12496)
Adds `WebKitWebViewWidgetCreationParams.uiKitGestureBlockingPolicy`, forwarded to `UiKitView.gestureBlockingPolicy`, so apps can opt in to an iOS gesture-blocking workaround when a web view becomes unresponsive to touches.
The default remains `UiKitViewGestureBlockingPolicy.fallbackToPluginDefault`, preserving existing behavior. The parameter has no effect on macOS. The `uiKit` prefix makes the platform scope explicit and leaves room for a separate macOS policy. Native plugin registration is unchanged.
### Why the minimum Flutter version is bumped
`UiKitView.gestureBlockingPolicy` landed in flutter#185126 and first shipped in stable **3.47.0** (it is not present in 3.44.x), so `flutter: ">=3.47.0"` is required to reference it at all. `validate` enforces a matching Dart lower bound, hence `sdk: ^3.13.0`, and that made this a minor version bump (`3.27.0`) rather than a patch.
Raising the package's language version to Dart 3.13 changes `dart format` output for files that were already checked in. That reformat is isolated in the original formatting commit. Current `main` already includes the Flutter 3.47.0 SDK mapping, so this PR no longer changes `script/tool`.
### Behavior and validation
`doNotBlockGesture` uses hit-test results to decide when to block the web view's gesture recognizers, without relying on Flutter's gesture arena. It remains an opt-in workaround that may allow gestures that should have been blocked. A widget test verifies that opting in still builds an `AppKitView` on macOS.
Local validation on Flutter 3.47.2 / Dart 3.13.2: all 158 package tests pass, including 7 widget tests; static analysis, repository formatting, README excerpt synchronization, package validation and license checks pass.
### Before / after
Both recorded on the same build against the same third-party cashier page, iOS 26.4 simulator (iPhone 17 Pro). `uiKitGestureBlockingPolicy` is the only difference between the two runs.
**Before** — `fallbackToPluginDefault`, i.e. the `eager` policy the plugin registers the platform view with. The first touch is delivered; after that the web view is dead: taps do nothing and drags never move `window.scrollY`.
https://github.com/user-attachments/assets/481d69d4-ba43-49fe-99dc-8534b79f67e3
**After** — `uiKitGestureBlockingPolicy: UiKitViewGestureBlockingPolicy.doNotBlockGesture`. Scrolling and tapping keep working for the rest of the session.
https://github.com/user-attachments/assets/01e7516c-4b53-4b11-98ee-8bd1b7119c4a
### Minimal repro
Still owed. I built a standalone project that mirrors the page shape which triggers it for us — a form taller than the viewport embedding four cross-origin iframes — and it does **not** reproduce, so the trigger is narrower than page geometry alone. The page that does trigger it reliably is a closed-source payment cashier I cannot share. I will keep reducing it.
One data point in the meantime: `flutter_inappwebview` also registers its iOS platform view via the two-argument `registrar.register(_:withId:)` (so, `eager`), and shows the same symptom on iOS 26 on the same page — which suggests the underlying issue is not specific to `webview_flutter`.
Related: flutter#175099, flutter#179907Fixesflutter#191267
## Pre-Review Checklist
0 commit comments