Skip to content

Fix reversed wheel/joystick scrolling in inverted lists - #58872

Open
pixelfreak wants to merge 1 commit into
react:mainfrom
pixelfreak:export-D122871988
Open

pixelfreak wants to merge 1 commit into
react:mainfrom
pixelfreak:export-D122871988

Conversation

@pixelfreak

Copy link
Copy Markdown

Summary:

  • On Android, an inverted FlatList flips its ScrollView with a transform. Android maps touch coordinates through that transform, but ACTION_SCROLL axis values (mouse wheel, trackpad, joystick) reach the view unchanged, so those inputs scroll inverted lists backwards.
  • ReactScrollView.onGenericMotionEvent now negates the vertical scroll axis when transforms on the view or its ancestors flip it vertically, and the snap velocity after a wheel scroll is flipped to match. Children of the list still receive the original event.
  • Checking the transforms rather than isInvertedVirtualizedList also covers other flipped ScrollViews, including an inverted list with a refreshControl, where the transform sits on the wrapping refresh layout.
  • ReactNestedScrollView is regenerated from the ReactScrollView sources.

Changelog:
[Android][Fixed] - Fix mouse wheel and joystick scrolling direction in inverted FlatList

Reviewed By: GijsWeterings, javache

Differential Revision: D122871988

Summary:
- On Android, an inverted `FlatList` flips its `ScrollView` with a transform. Android maps touch coordinates through that transform, but `ACTION_SCROLL` axis values (mouse wheel, trackpad, joystick) reach the view unchanged, so those inputs scroll inverted lists backwards.
- `ReactScrollView.onGenericMotionEvent` now negates the vertical scroll axis when transforms on the view or its ancestors flip it vertically, and the snap velocity after a wheel scroll is flipped to match. Children of the list still receive the original event.
- Checking the transforms rather than `isInvertedVirtualizedList` also covers other flipped `ScrollView`s, including an inverted list with a `refreshControl`, where the transform sits on the wrapping refresh layout.
- `ReactNestedScrollView` is regenerated from the `ReactScrollView` sources.

Changelog:
[Android][Fixed] - Fix mouse wheel and joystick scrolling direction in inverted `FlatList`

Reviewed By: GijsWeterings, javache

Differential Revision: D122871988
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 6, 2026
@meta-codesync

meta-codesync Bot commented Oct 6, 2026

Copy link
Copy Markdown

@pixelfreak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D122871988.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant