Skip to content

fix(scroll): enable maintainVisibleContentPosition for horizontal lists#2145

Merged
naqvitalha merged 3 commits intomainfrom
fix/1817-mvcp-horizontal
Mar 23, 2026
Merged

fix(scroll): enable maintainVisibleContentPosition for horizontal lists#2145
naqvitalha merged 3 commits intomainfrom
fix/1817-mvcp-horizontal

Conversation

@naqvitalha
Copy link
Collaborator

@naqvitalha naqvitalha commented Mar 11, 2026

Summary

  • Removes the !horizontal restriction from shouldMaintainVisibleContentPosition() in RecyclerViewManager
  • The offset correction logic and ScrollAnchor already handle horizontal correctly — the restriction was unnecessary

Fixes #1817

Test plan

  • Verify MVCP works in horizontal FlashList (prepend items, scroll position should be maintained)
  • Verify vertical MVCP still works as before (no regression)
  • Unit tests pass (yarn test)

@naqvitalha naqvitalha force-pushed the fix/1817-mvcp-horizontal branch from 7573ef9 to 23d90d8 Compare March 11, 2026 22:56
Add a sample screen demonstrating maintainVisibleContentPosition
working with horizontal FlashLists. The sample allows prepending
and appending items to verify scroll position is maintained.
@naqvitalha naqvitalha merged commit 422dcda into main Mar 23, 2026
13 checks passed
@naqvitalha naqvitalha deleted the fix/1817-mvcp-horizontal branch March 23, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2: maintainVisibleContentPosition doesn't work in horizontal

2 participants