Skip to content

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

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

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

Conversation

@pixelfreak

@pixelfreak pixelfreak commented Oct 6, 2026 •

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

@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.

@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Oct 6, 2026
@meta-codesync meta-codesync Bot changed the title Fix reversed wheel/joystick scrolling in inverted lists Fix reversed wheel/joystick scrolling in inverted lists (#58872) Oct 6, 2026
pixelfreak pushed a commit to pixelfreak/react-native that referenced this pull request Oct 6, 2026
Summary:
Pull Request resolved: react#58872

- 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-codesync meta-codesync Bot changed the title Fix reversed wheel/joystick scrolling in inverted lists (#58872) Fix reversed wheel/joystick scrolling in inverted lists Oct 6, 2026
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-codesync meta-codesync Bot closed this in 30e2d93 Oct 7, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 7, 2026
@meta-codesync

meta-codesync Bot commented Oct 7, 2026

Copy link
Copy Markdown

This pull request has been merged in 30e2d93.

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. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant