Skip to content

[ios] Skip non-tappable web view workaround for iOS 26.4 #185372

Description

@hellohuanlin

Apple fixed the non-tappable web view bug on iOS 26.4. This means we can skip the hacky workarounds on iOS 26.4

// On iOS 18.2, WKWebView's internal recognizer likely caches the old state of its blocking
// recognizers (i.e. delaying recognizer), resulting in non-tappable links. See
// https://github.com/flutter/flutter/issues/158961. Removing and adding back the delaying
// recognizer solves the problem, possibly because UIKit notifies all the recognizers related
// to (blocking or blocked by) this recognizer. It is not possible to inject this workaround
// from the web view plugin level. Right now we only observe this issue for
// FlutterPlatformViewGestureRecognizersBlockingPolicyEager, but we should try it if a similar
// issue arises for the other policy.
if (@available(iOS 26.0, *)) {
// This performs a nested DFS, with the outer one searching for any web view, and the inner
// one searching for a TouchEventsGestureRecognizer inside the web view. Once found, disable
// and immediately reenable it to reset its state.
// TODO(hellohuanlin): remove this flag after it is battle tested.
NSNumber* isWorkaroundDisabled =
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTDisableWebViewGestureReset"];
if (!isWorkaroundDisabled.boolValue) {
[self searchAndFixWebView:self.embeddedView];
}
} else if (@available(iOS 18.2, *)) {
// The 1P web view plugin provides a WKWebView itself as the platform view. However, some 3P
// plugins provide wrappers of WKWebView instead, and AdMob banner has a WKWebView at
// depth 7. So we perform DFS to search the view hierarchy.
if ([self containsWebView:self.embeddedView]) {
[self removeGestureRecognizer:self.delayingRecognizer];
[self addGestureRecognizer:self.delayingRecognizer];
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsc: tech-debtTechnical debt, code quality, testing, etc.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions