Skip to content

Comments

Fix disappearing cards in masonry when optimizeItemArrangement is dis…#2104

Open
j0sip wants to merge 2 commits intoShopify:mainfrom
j0sip:2103-fix-disappearing-cards
Open

Fix disappearing cards in masonry when optimizeItemArrangement is dis…#2104
j0sip wants to merge 2 commits intoShopify:mainfrom
j0sip:2103-fix-disappearing-cards

Conversation

@j0sip
Copy link
Contributor

@j0sip j0sip commented Feb 16, 2026

Description

Fixes (issue #2103)

This PR fixes an issue in masonry layout where cards unexpectedly disappear as user scrolls when optimizeItemArrangement is disabled.

It adds a new arrays of sorted layout indices to MasonryLayoutManager, which enables correct binary search when calculating visible items. Current implementation of binary search fails when optimizeItemArrangement is disabled, because the array of layouts is not sorted by y position. This leads to incorrect results when column heights are different.

The fix only affects masonry layout and only when optimizeItemArrangement === false, since the issue is not occurring when the prop is enabled.

Reviewers’ hat-rack 🎩

  • [ ]

Screenshots or videos (if needed)

Video (after disabling optimizeItemArrangement in ComplexMasonry from fixture app:

flashlist-fix.mp4

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.

Disappearing items in Masonry layout

1 participant