Skip to content

Conversation

@hellohuanlin
Copy link
Contributor

@hellohuanlin hellohuanlin commented Dec 15, 2025

This is a quick fix to the web view/admob not tappable issue. It performs DFS on a platform view hierarchy to find a web view. If found, it performs another DFS into the web view to "fix" a gesture recognizer.

Warning: This is just a "quick fix" that patches the bug. However, a real solution should rely on overriding the "hitTest" behavior.

For example, there's still a existing bug that a drawing website's touch is not completely blocked (see #179916). This can only be fixed by "hitTest". However, "hitTest" approach requires plugin updates and would take much longer time, so we decided to revert it. But we should revisit after putting out the fire.

#175099
#165787

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions bot added platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. team-ios Owned by iOS platform team labels Dec 15, 2025
├── Child 1
└── Child 2
├── Child 2.1
└── Child 2.2 [*]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this mimic a simple use case with just 1 web view

└── Child 3
└── Child 3.1 (Web View)
├── Child 3.1.1
└── Child 3.1.2 [*]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a platform view with 2 web views

└── Child 3.1.1
└── Child 3.1.2
├── Child 3.1.2.1
└── Child 3.1.2.2 [*]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is when adding a web view inside another web view. I doubt anyone would do that, but just add this to verify correctness of DFS

@hellohuanlin hellohuanlin changed the title Pv ios26 web view double dfs [ios][pv] quick fix to enable and re-enable web view's gesture recognizer Dec 15, 2025
@hellohuanlin hellohuanlin marked this pull request as ready for review December 15, 2025 23:34
@hellohuanlin hellohuanlin requested a review from a team as a code owner December 15, 2025 23:34
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like integration tests for these gesture issues instead of unit tests checking the hacks. That will let us detect this with betas in CI instead of manual testing being needed. Can be a follow-up PR.

for (UIGestureRecognizer* recognizer in recognizers) {
if (recognizer.enabled &&
[NSStringFromClass([recognizer class]) hasSuffix:@"TouchEventsGestureRecognizer"]) {
recognizer.enabled = NO;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a comment, a link back to an issue or PR comment about what this is working around.

Copy link
Contributor Author

@hellohuanlin hellohuanlin Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (added at 3 lines above):

    // This is to fix a bug on iOS 26 where web view link is not tappable.
    // We reset the web view's WKTouchEventsGestureRecognizer in a bad state
    // by disabling and re-enabling it.
    // See: https://github.com/flutter/flutter/issues/175099.
    // See also: https://github.com/flutter/engine/pull/56804 for an explanation of the
    // bug on iOS 18.2, which is still valid on iOS 26.
    // Warning: This is just a quick fix that patches the bug. For example,
    // touches on a drawing website is still not completely blocked. A proper solution
    // should rely on overriding the hitTest behavior.
    // See: https://github.com/flutter/flutter/issues/179916.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but @vashworth should review.

Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vashworth
Copy link
Contributor

@hellohuanlin
Copy link
Contributor Author

github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2025
#179895)

…dget API) (#179659)"

This reverts commit 87d1589.

*Replace this paragraph with a description of what this PR is changing
or adding, and why. Consider including before/after screenshots.*

We found a quick fix ([PR
here](#179908)), so revert it and
revisit `hitTest` later.

*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*

NA

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
@hellohuanlin hellohuanlin force-pushed the pv_ios26_web_view_double_dfs branch from d696b2c to cc1327e Compare December 16, 2025 22:38
@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 17, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Dec 17, 2025
Merged via the queue into flutter:master with commit db4e210 Dec 17, 2025
180 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 17, 2025
@hellohuanlin hellohuanlin added the cp: beta cherry pick this pull request to beta release candidate branch label Dec 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 18, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 18, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 18, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 21, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 21, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 21, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 22, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 22, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 22, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
stuartmorgan-g pushed a commit to flutter/packages that referenced this pull request Dec 23, 2025
Manual roll Flutter from d81baab to 57c3f8b (38 revisions)

Manual roll requested by stuartmorgan@google.com

flutter/flutter@d81baab...57c3f8b

2025-12-17 bruno.leroux@gmail.com Add FloatingActionButtonTheme
(flutter/flutter#179736)
2025-12-17 engine-flutter-autoroll@skia.org Roll Skia from b1569739f431
to fb576bd6827a (1 revision) (flutter/flutter#179989)
2025-12-17 bruno.leroux@gmail.com Update more comments related to theme
normalization (flutter/flutter#179682)
2025-12-17 engine-flutter-autoroll@skia.org Roll Skia from cce9b86bda7d
to b1569739f431 (1 revision) (flutter/flutter#179979)
2025-12-17 jobguldemeester@gmail.com Adds property passthrough for
CheckboxListTile, SwitchListTile and RadioListTile
(flutter/flutter#178098)
2025-12-17 engine-flutter-autoroll@skia.org Roll Dart SDK from
ca949b915846 to 3793f3d2d0c4 (2 revisions) (flutter/flutter#179973)
2025-12-17 engine-flutter-autoroll@skia.org Roll Skia from 318400199beb
to cce9b86bda7d (1 revision) (flutter/flutter#179976)
2025-12-17 ahmedsameha1@gmail.com Make sure that a
CupertinoTextFormFieldRow doesn't crash in 0x0 envir…
(flutter/flutter#179932)
2025-12-17 ahmedsameha1@gmail.com Make sure that a CupertinoTabView
doesn't crash in 0x0 environment (flutter/flutter#179845)
2025-12-17 ahmedsameha1@gmail.com Make sure that a CupertinoTextField
doesn't crash in 0x0 environment (flutter/flutter#179865)
2025-12-17 ahmedsameha1@gmail.com Make sure that a CupertinoSwitch
doesn't crash in 0x0 environment (flutter/flutter#179748)
2025-12-17 116356835+AbdeMohlbi@users.noreply.github.com Update
`BuildContext` docs to make it easier to understand
(flutter/flutter#178616)
2025-12-17 41930132+hellohuanlin@users.noreply.github.com [ios][pv]
quick fix to enable and re-enable web view's gesture recognizer
(flutter/flutter#179908)
2025-12-17 biggs0125@gmail.com Deduplicate wasm dry run entries in
analytics. (flutter/flutter#179970)
2025-12-17 engine-flutter-autoroll@skia.org Roll Skia from 99899cbb415b
to 318400199beb (1 revision) (flutter/flutter#179969)
2025-12-17 engine-flutter-autoroll@skia.org Roll Skia from 2ac4a8709bc9
to 99899cbb415b (1 revision) (flutter/flutter#179968)
2025-12-17 engine-flutter-autoroll@skia.org Roll Dart SDK from
95a92bc705d3 to ca949b915846 (6 revisions) (flutter/flutter#179967)
2025-12-17 biggs0125@gmail.com Add package info to wasm dry run events.
(flutter/flutter#179826)
2025-12-17 matt.boetger@gmail.com Platform View Hide/Show Integration
test (flutter/flutter#179902)
2025-12-16 engine-flutter-autoroll@skia.org Roll Skia from 61162d72343f
to 2ac4a8709bc9 (14 revisions) (flutter/flutter#179961)
2025-12-16 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from
433KtmJvbMyaDMJvD... to fAoyBAT99XxwPE5hL... (flutter/flutter#179960)
2025-12-16 bkonyi@google.com [ Tool ] Fix update-packages not accounting
for path dependencies (flutter/flutter#179951)
2025-12-16 45459898+RamonFarizel@users.noreply.github.com ListTile fix
MinIntrinsicHeight calculation (flutter/flutter#179515)
2025-12-16 108678139+manu-sncf@users.noreply.github.com Fix pinned
header in NestedScrollView (flutter/flutter#179210)
2025-12-16 bruno.leroux@gmail.com Update some comments related to theme
normalization (flutter/flutter#179624)
2025-12-16 iliyazelenkog@gmail.com Add Cyrillic keyboard layout support
for flutter_tools terminal commands (flutter/flutter#177855)
2025-12-16 lauren@selfisekai.rocks Minor fixes for libstdc++ 15
(flutter/flutter#178601)
2025-12-16 34465683+rkishan516@users.noreply.github.com Feat: Add top
gap for cupertino sheet (flutter/flutter#171348)
2025-12-16 116356835+AbdeMohlbi@users.noreply.github.com Align
`Build.API_LEVELS` usage in `FlutterImageDecoder.java‎` with existing
usage (flutter/flutter#179868)
2025-12-16 41930132+hellohuanlin@users.noreply.github.com Revert
"[ios][pv] accept/reject gesture based on hitTest (with new wi…
(flutter/flutter#179895)
2025-12-16 codefu@google.com fix: line endings for
flutter/dart/flutter-dev (flutter/flutter#179912)
2025-12-16 22373191+Hari-07@users.noreply.github.com Platform view blur
clipping - Rounded Rect (iOS) (flutter/flutter#177551)
2025-12-16 engine-flutter-autoroll@skia.org Roll Dart SDK from
20d114f951db to 95a92bc705d3 (1 revision) (flutter/flutter#179909)
2025-12-16 34871572+gmackall@users.noreply.github.com [Reland]
Unmodified android sdk bundle (flutter/flutter#179920)
2025-12-16 engine-flutter-autoroll@skia.org Roll Skia from 6903a4e65c3f
to 61162d72343f (2 revisions) (flutter/flutter#179915)
2025-12-16 engine-flutter-autoroll@skia.org Roll Packages from
2cd921c to 57725eb (1 revision) (flutter/flutter#179942)
2025-12-16 45490440+shindonghwi@users.noreply.github.com Filter out
FrameEvents/updateAcquireFence log spam from adb logcat
(flutter/flutter#179884)
2025-12-16 30870216+gaaclarke@users.noreply.github.com `flutter
update-packages --force-upgrade --update-hashes`
(flutter/flutter#179950)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to
ensure that a human
is aware of the problem.
...
hellohuanlin added a commit that referenced this pull request Jan 5, 2026
…izer (#179908)

This is a quick fix to the web view/admob not tappable issue. It
performs DFS on a platform view hierarchy to find a web view. If found,
it performs another DFS into the web view to "fix" a gesture recognizer.

Warning: This is just a "quick fix" that patches the bug. However, a
real solution should rely on overriding the "hitTest" behavior.

For example, there's still a existing bug that a drawing website's touch
is not completely blocked (see
#179916). This can only be
fixed by "hitTest". However, "hitTest" approach requires plugin updates
and would take much longer time, so we decided to [revert
it](#179895). But we should
revisit after putting out the fire.

#175099
#165787


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
auto-submit bot pushed a commit that referenced this pull request Jan 5, 2026
…sture recognizer (#180522)

Stable CP PR: #180522
Beta CP PR: #179974
Original PR: #179908

The "cherry-pick template" linked in https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process/e7b042dd481d4ac66477fb281b6e626e8dba8a4e seems to be broken, so I copied the template from previous CP. 

### Issue Link:
What is the link to the issue this cherry-pick is addressing?

#175099
#165787

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?
Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
or the shipping of production apps (the app crashes on launch).
This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.

WebViews (including ads) on iOS 26 are unclickable after being scrolled or after a Flutter menu is open and then closed. This is a serious regression that impacts revenue. This impacts all Flutter apps running on iOS 26 that use WebViews.

### Changelog Description:
Explain this cherry pick:
* In one line that is accessible to most Flutter developers.
* That describes the state prior to the fix.
* That includes which platforms are impacted.
See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples.

< Replace with changelog description here >
[flutter/165787, flutter/175099] When WebViews are scrolled on iOS 26, they become unclickable.

### Workaround:
Is there a workaround for this issue?

None

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
What are the steps to validate that this fix works?

Use sample project from #165787 (comment). Touch and scroll on an ad, then try to click the ad. The ad will be unclickable.

#175099
#165787

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cp: beta cherry pick this pull request to beta release candidate branch engine flutter/engine related. See also e: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants