feat: Fix for Pull to Refresh IAB gesture bug#26373
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The BrowserTab is a critical component used by many E2E tests that interact with dApps. While the changes are well-covered by unit tests, they fundamentally change how gestures are handled in the browser view. Tests that navigate to dApps and interact with them could be affected:
The risk is medium because while the changes are localized to gesture handling and have comprehensive unit tests, they affect a fundamental interaction pattern in the browser that many tests rely on. Performance Test Selection: |
|
|
Missing release label release-7.66.0 on PR. Adding release label release-7.66.0 on PR and removing other release labels(release-7.68.0), as PR was cherry-picked in branch 7.66.0. |



Description
Pull-to-refresh gesture was intercepting taps on buttons near the top of the page (e.g., Polymarket "Sign Up" / "Log In" buttons). The gesture handler called
stateManager.activate()immediately inonTouchesDownfor the pull zone (y < 50px), stealing the touch from the WebView before knowing whether the user intended to tap or pull.Changes
Deferred activation for pull-to-refresh: Instead of activating immediately, the gesture enters a
pending_refreshstate inonTouchesDown. NewonTouchesMoveandonTouchesUphandlers measure the movement delta:Gesture.Simultaneousinstead ofGesture.Race: Deferred activation requires that the Native gesture (WebView scroll) does not cancel our Pan while it is deciding.Gesture.Simultaneousallows both to run independently — taps pass through to the WebView while our Pan stays in BEGAN state deciding, and when Pan activates for a real pull at the top of the page, the WebView has nothing to scroll so both coexist without visual conflict.Why not other approaches
Gesture.Race+ deferred activation: Native wins the race and cancels Pan beforeonTouchesMovefiresGesture.Race+ immediate activation + synthetic JS click replay: Pull-to-refresh works but synthetic events haveisTrusted = false— React ignores themGesture.Exclusive+ deferred activation: Blocks Native while Pan is in BEGAN — nothing worksChangelog
CHANGELOG entry: Fixed pull-to-refresh gesture intercepting taps on buttons near the top of the page in the in-app browser
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-352
Manual testing steps
Screenshots/Recordings
Before
After
polymarketBugFix.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches core in-app browser gesture coordination; a subtle change from
RacetoSimultaneousplus new activation heuristics could cause regressions in gesture priority/scroll behavior across platforms.Overview
Fixes pull-to-refresh stealing taps near the top of the in-app browser by deferring pull activation:
onTouchesDownnow enters apending_refreshstate and only activates refresh after sufficient downward movement, otherwise failing on tap/horizontal/upward movement.Updates gesture composition from
Gesture.RacetoGesture.Simultaneousso the WebView’s native handler can still receive taps while the pan gesture decides, and introducesPULL_MOVE_ACTIVATION(10px) plus expanded unit tests covering the newonTouchesMove/onTouchesUpflow and edge cases.Written by Cursor Bugbot for commit 59a6058. This will update automatically on new commits. Configure here.