Repository navigation
Conversation
Contributor
Author
|
Reproduction recordings and standalone native harness: before.mp4after.mp4 |
javache
approved these changes
Oct 21, 2026
|
@javache has imported this pull request. If you are a Meta employee, you can view this in D126637111. |
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:
When a parent intercepts an already-started ScrollView drag, Android delivers ACTION_CANCEL. The current ACTION_UP-only condition skips END_DRAG, the native gesture end notification, resetting dragging, and post-touch cleanup.
Handle ACTION_CANCEL alongside ACTION_UP in ReactScrollView, ReactHorizontalScrollView, and ReactNestedScrollView. Cancellation preserves the tracked velocity and uses the existing post-touch settling pipeline, including configured momentum events and page alignment. The nested component was regenerated with its source generator.
Changelog:
[ANDROID] [FIXED] - Finish interrupted ScrollView drags when receiving ACTION_CANCEL.
Test Plan:
Current upstream source: 12 Robolectric cases passed, 0 failures and 0 skipped, on c7429b0 plus this patch. Each vertical, horizontal, and nested component is covered for cancellation ending a drag exactly once, cancellation without dragging, normal UP behavior, and post-touch cleanup notifying native scroll-ended listeners and disabling the FPS listener.
The JVM run compiled RN Kotlin/Java from source; the excluded tasks prepare C++ headers. git diff --check, formatting of the new Kotlin test, and the nested-scroll generator --verify check also passed.
Android emulator: Built before/after native harness APKs using the real RN 0.83.10 vertical ReactScrollView on Android 16 ARM64. The RN source differs only in the terminal-action condition. After RN emits BEGIN_DRAG, the parent intercepts the stream and Android itself delivers CANCEL.
All 12 before/after emulator scenarios matched expectations: drag + cancel, drag + up, cancel without dragging, repeated cancellation, paging-enabled cancellation, and cancellation with momentum events disabled. Paging-enabled cancellation settled with balanced momentum events.
The recordings demonstrate native event emission and cleanup on RN 0.83.10; the harness does not run a JS VM. Current-source coverage for horizontal/nested components comes from the Robolectric tests above.
Reproduction evidence
Before the fix:
END_DRAG=0,dragging=true, FPS listener remains enabled after cancellation.before.mp4
After the fix:
END_DRAG=1,dragging=false, native gesture end and post-touch cleanup complete.after.mp4
Download the standalone native reproducer, recordings, and emulator results. See its README for setup and the exact verification scope.