Patch react-native-draggable-flatlist to unblock iOS autoscroll#90617
Patch react-native-draggable-flatlist to unblock iOS autoscroll#90617MelvinBot wants to merge 4 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>
|
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. |
📲 Install BuildsAndroid
|
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 |
|
…eListAutoscroll Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
Done! Here's what I did:
|
|
@MelvinBot Please merge main |
…eListAutoscroll Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
✅ 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] |
|
@truph01 is this something that you're still working on? |
|
@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. |
|
@truph01 can you put it back into draft mode until it's ready to review? |
|
@MelvinBot Merge main |
…eListAutoscroll Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
🤖 Merged |
|
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai. |
|
@MelvinBot Mark this PR as ready for review |
truph01
left a comment
There was a problem hiding this comment.
Code changes look good and test well.
|
@truph01 PR author checklist is incomplete (I think you can do it in a comment) |
Explanation of ChangeOn iOS, This patch adds a single line to Fixed Issues$ #87362 Tests
Offline testsN/A — this change affects native drag gesture scrolling only, not network behavior. QA Steps
PR Author Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / Safari |
|
@truph01 do you want to add a link to this PR as the PR introducing patch? |
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