Skip to content

Fix inverted FlatList RefreshControl indicator position#55464

Open
Navjot1806 wants to merge 2 commits intofacebook:mainfrom
Navjot1806:fix/inverted-flatlist-refresh-indicator
Open

Fix inverted FlatList RefreshControl indicator position#55464
Navjot1806 wants to merge 2 commits intofacebook:mainfrom
Navjot1806:fix/inverted-flatlist-refresh-indicator

Conversation

@Navjot1806
Copy link

Summary

Fixes #17553

When using an inverted FlatList with onRefresh/refreshing, the RefreshControl activity indicator appears at the visual bottom of the list instead of the visual top. This is because the scaleY: -1 transform applied to the ScrollView flips the entire view including the RefreshControl.

This PR automatically sets progressViewOffset on the RefreshControl when the list is inverted, repositioning the refresh indicator at the visual top of the list. The offset is calculated from the visible height of the scroll view after layout.

Changes

  • VirtualizedList.js: In _defaultRenderScrollComponent, when isInvertedVirtualizedList is true and the user hasn't provided a custom progressViewOffset, automatically calculate and pass progressViewOffset equal to visibleLength to reposition the refresh indicator at the visual top.
  • VirtualizedList-test.js: Added 3 new test cases:
    • Verifies progressViewOffset is set on RefreshControl when inverted and layout is known
    • Verifies progressViewOffset is NOT set when the list is not inverted
    • Verifies user-provided progressViewOffset is respected when inverted

Behavior

Scenario Before After
Inverted + onRefresh Indicator at visual bottom Indicator at visual top
Non-inverted + onRefresh Indicator at top (unchanged) Indicator at top (unchanged)
Inverted + custom progressViewOffset Uses custom value Uses custom value (unchanged)

Note

This fix repositions the visual indicator to the correct location. The pull-to-refresh gesture direction (which is tied to the native scroll view behavior) would require native-level changes to fully resolve and is tracked separately.

Changelog

[GENERAL] [FIXED] - Fix inverted FlatList RefreshControl indicator appearing at the visual bottom instead of visual top (#17553)

Test Plan

  • Added 3 new unit tests in VirtualizedList-test.js that verify the progressViewOffset behavior for inverted lists
  • All existing 76 tests continue to pass
  • All FlatList and VirtualizedSectionList tests pass

🤖 Generated with Claude Code

When using an inverted FlatList with onRefresh/refreshing, the
RefreshControl activity indicator appears at the visual bottom of the
list instead of the visual top. This is because the scaleY: -1 transform
applied to the ScrollView flips the entire view including the
RefreshControl.

This fix automatically sets progressViewOffset on the RefreshControl
when the list is inverted, repositioning the refresh indicator at the
visual top of the list. The offset is calculated from the visible height
of the scroll view after layout.

The user-provided progressViewOffset is respected when explicitly set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@meta-cla
Copy link

meta-cla bot commented Feb 7, 2026

Hi @Navjot1806!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Caution

Missing Changelog

Please add a Changelog to your PR description. See Changelog format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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 Feb 7, 2026
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Feb 7, 2026
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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inverted FlatList displays activity indicator at the bottom

2 participants