Repository navigation
Conversation
Visual regressionNo visual differences at android: no capture |
ide
marked this pull request as ready for review
December 3, 2026 03:07
Summary: react#60367 lets a scroll view inside a `ScrollView` that is the JavaScript responder cancel the touches that began inside it. `RCTSurfaceTouchHandler` and `RCTSurfacePointerHandler` each kept their own copy of the bookkeeping for those cancelled touches, and only the touch handler's cancel had a test. chrfalch's review of react#60367 suggested sharing the bookkeeping and testing the pointer handler (react#60367 (review)). This change moves the bookkeeping into `RCTCancelledTouches`, a C++ class both handlers hold. It is declared in `RCTCancelledTouches+Internal.h`, which the C++ API snapshots leave out. Behavior doesn't change. Changelog: [Internal] - Share the cancelled-touch bookkeeping of the iOS touch and pointer handlers, and test the pointer handler's cancel Test Plan: `RCTScrollViewComponentViewTests` gains `testDragUnderScrollViewJSResponderCancelsOnlyThePointersInsideTheScrollView`. It checks that a drag cancels only the pointers inside the inner scroll view, that the cancelled touch's later events are dropped, that a touch beginning inside waits until the cancelled one ends, and that `reset` clears the state. It and the existing touch-handler test pass before and after the move, and breaking each part of the bookkeeping makes one of them fail. I didn't run the change in RNTester. ```sh xcodebuild test -workspace packages/rn-tester/RNTesterPods.xcworkspace -scheme React-RCTFabric-Unit-Tests \ -destination 'platform=iOS Simulator,name=iPhone 18 Pro' ``` RNTester's Podfile doesn't install the `React-RCTFabric` `Tests` spec, so open-source CI doesn't run these tests. `yarn format-check-cpp` passes. Signed-off-by: James Ide <ide@expo.dev>
ide
force-pushed
the
@ide/ios-touch-cancel-bookkeeping
branch
from
December 3, 2026 13:31
78c79b2 to
d73f6d5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
#60367 lets a scroll view inside a
ScrollViewthat is the JavaScript responder cancel the touches that began inside it.RCTSurfaceTouchHandlerandRCTSurfacePointerHandlereach kept their own copy of the bookkeeping for those cancelled touches, and only the touch handler's cancel had a test. chrfalch's review of #60367 suggested sharing the bookkeeping and testing the pointer handler (#60367 (review)).This change moves the bookkeeping into
RCTCancelledTouches, a C++ class both handlers hold. It is declared inRCTCancelledTouches+Internal.h, which the C++ API snapshots leave out. Behavior doesn't change.Changelog:
[Internal] - Share the cancelled-touch bookkeeping of the iOS touch and pointer handlers, and test the pointer handler's cancel
Test Plan:
RCTScrollViewComponentViewTestsgainstestDragUnderScrollViewJSResponderCancelsOnlyThePointersInsideTheScrollView. It checks that a drag cancels only the pointers inside the inner scroll view, that the cancelled touch's later events are dropped, that a touch beginning inside waits until the cancelled one ends, and thatresetclears the state. It and the existing touch-handler test pass before and after the move, and breaking each part of the bookkeeping makes one of them fail. I didn't run the change in RNTester.RNTester's Podfile doesn't install the
React-RCTFabricTestsspec, so open-source CI doesn't run these tests.yarn format-check-cpppasses.