Patch react-native-draggable-flatlist to unblock iOS autoscroll#90617
Open
MelvinBot wants to merge 3 commits into
Open
Patch react-native-draggable-flatlist to unblock iOS autoscroll#90617MelvinBot wants to merge 3 commits into
MelvinBot wants to merge 3 commits into
Conversation
…ack loop
On iOS, scrollToOffset({animated: true}) does not emit intermediate onScroll
events, so the scrollOffset shared value never updates mid-scroll. This blocks
the autoscroll feedback loop in useAutoScroll (hasScrolledToTarget stays false),
preventing drag-to-reorder from scrolling beyond the visible viewport.
The fix manually advances scrollOffset after each scrollToOffset call, keeping
the animated scroll for smooth visuals while unblocking the next loop iteration.
Co-authored-by: truph01 <truph01@users.noreply.github.com>
Contributor
Author
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
7 tasks
📲 Install BuildsAndroid
|
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-05-18.at.14.10.58.movAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-05-14.at.15.01.01.movScreen.Recording.2026-05-14.at.15.01.40.moviOS: mWeb SafariMacOS: Chrome / Safari |
Contributor
|
…eListAutoscroll Co-authored-by: truph01 <truph01@users.noreply.github.com>
Contributor
Author
|
Done! Here's what I did:
|
Contributor
|
@MelvinBot Please merge main |
…eListAutoscroll Co-authored-by: truph01 <truph01@users.noreply.github.com>
Contributor
Author
|
✅ Merged |
|
@mjasikowski Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Contributor
|
@truph01 is this something that you're still working on? |
Contributor
|
@mjasikowski Yes, I’m currently working on it. I still need to test a few things related to the scroll behavior with the current solution in this PR. |
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.
Explanation of Change
On iOS,
scrollToOffset({animated: true})does not emit intermediateonScrollevents — only one at the end of the animation. The autoscroll feedback loop inreact-native-draggable-flatlist'suseAutoScrollhook gates each iteration onhasScrolledToTarget(i.e.,scrollTarget - scrollOffset < 2px). BecausescrollOffsetnever updates mid-scroll on iOS, this gate stays closed after the first edge hit, and the loop stalls. The dragged waypoint gets stuck within the visible viewport.This patch adds a single line to
scrollToInternalinuseAutoScroll.tsx: after callingscrollToOffset({animated: true}), it manually setsscrollOffset.value = offset. This immediately unblockshasScrolledToTargetso the loop can compute the next scroll step, while the animated scroll still runs for smooth visuals.Fixed Issues
$ #87362
PROPOSAL: #87362 (comment)
Tests
Offline tests
N/A — this change affects native drag gesture scrolling only, not network behavior.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.AI Tests
./scripts/validatePatches.shnpx prettier --writeon changed filesScreenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari