Fix idle momentum end on iOS (#58658) - #58658
Abbondanzo wants to merge 2 commits into
Conversation
|
@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D121477503. |
|
/review |
🤖 AI code reviewDecision: Ready for human review (with comments) Overall PR risk: Medium. The change modifies existing behavior in iOS ScrollView momentum-end emission on unmount and VirtualizedList onEndReached and onStartReached gating. The affected surface covers ScrollView and FlatList users, with narrow guards and direct rollback by revert. The kept finding shows the tester Scroll to start path never enables recording, so first use leaves output at running, while the broader plausible break is missed or extra momentum-end and edge callbacks. 🟡 Warning (1)
This review is advisory — it never blocks a merge and never auto-approves. |
fa08d3d to
d2602a7
Compare
Summary: Unmounting an idle `ScrollView` could incorrectly dispatch `onMomentumScrollEnd` because a non-tracking scroll view was treated as moving. Check `UIScrollView.isDecelerating` before the view leaves its window so the event is emitted only when momentum is active. Add native regression coverage plus a shared RNTester Maestro flow. The flow runs on Android and iOS and verifies an idle unmount emits no momentum event, one fling emits exactly one begin/end pair, and a later unmount does not increment the count. Changelog: [iOS][Fixed] - Prevent idle `ScrollView`s from firing `onMomentumScrollEnd` during unmount Differential Revision: D121477503
Summary: Unmounting an idle `ScrollView` could incorrectly dispatch `onMomentumScrollEnd` because a non-tracking scroll view was treated as moving. Check `UIScrollView.isDecelerating` before the view leaves its window so the event is emitted only when momentum is active. Add native regression coverage plus a shared RNTester Maestro flow. The flow runs on Android and iOS and verifies an idle unmount emits no momentum event, one fling emits exactly one begin/end pair, and a later unmount does not increment the count. Changelog: [iOS][Fixed] - Prevent idle `ScrollView`s from firing `onMomentumScrollEnd` during unmount Differential Revision: D121477503
d2602a7 to
33d480b
Compare
Summary: Programmatic list scrolling can move to an edge before asynchronously scheduled cells finish rendering. The scroll handler then skips the edge callback because the terminal cell is not yet in the render window, and no later scroll or layout event is guaranteed. Recheck edge callbacks after post-scroll render updates. Track the item count when an edge callback is sent so internal measurement changes cannot emit duplicates while the list remains at the same edge; appending data or scrolling away re-arms the callback. Changelog: [General][Fixed] - Fire `VirtualizedList` edge callbacks after programmatic scrolling Differential Revision: D100870075
Summary: Unmounting an idle `ScrollView` could incorrectly dispatch `onMomentumScrollEnd` because a non-tracking scroll view was treated as moving. Check `UIScrollView.isDecelerating` before the view leaves its window so the event is emitted only when momentum is active. Add native regression coverage plus a shared RNTester Maestro flow. The flow runs on Android and iOS and verifies an idle unmount emits no momentum event, one fling emits exactly one begin/end pair, and a later unmount does not increment the count. Changelog: [iOS][Fixed] - Prevent idle `ScrollView`s from firing `onMomentumScrollEnd` during unmount Differential Revision: D121477503
33d480b to
145b163
Compare
Summary:
Unmounting an idle
ScrollViewcould incorrectly dispatchonMomentumScrollEndbecause a non-tracking scroll view was treated as moving. CheckUIScrollView.isDeceleratingbefore the view leaves its window so the event is emitted only when momentum is active.Add native regression coverage plus a shared RNTester Maestro flow. The flow runs on Android and iOS and verifies an idle unmount emits no momentum event, one fling emits exactly one begin/end pair, and a later unmount does not increment the count.
Changelog:
[iOS][Fixed] - Prevent idle
ScrollViews from firingonMomentumScrollEndduring unmountDifferential Revision: D121477503