Conversation
Addresses an issue with sticky header indices. Improves header behavior for push effect. It now computes next sticky position and item size. Adds a property to determine the position.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 370df1e43c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (currentStickyArrayIdx >= 0 && currentStickyArrayIdx < stickyIndicesArr.length - 1) { | ||
| const nextStickyDataIndex = stickyIndicesArr[currentStickyArrayIdx + 1]; | ||
| const nextStickyId = idCache[nextStickyDataIndex] ?? getId(state, nextStickyDataIndex); | ||
| const nextStickyPos = nextStickyId ? positions.get(nextStickyId) : undefined; | ||
| const prevNextPos = peek$(ctx, `containerStickyNextPosition${containerIndex}`); | ||
| if (nextStickyPos !== prevNextPos) { | ||
| set$(ctx, `containerStickyNextPosition${containerIndex}`, nextStickyPos); |
There was a problem hiding this comment.
Reset next-sticky position when no successor exists
This branch only updates containerStickyNextPosition when the current sticky item has a following sticky index, but it never clears the previous value when the container is reused for the last sticky item. In calculateItemsInView, a recycled sticky container can therefore keep a stale next-position from an earlier header, and PositionViewSticky/ReanimatedPositionViewSticky will still enable push behavior and push the final sticky header offscreen incorrectly. Add an else path to explicitly set containerStickyNextPosition to undefined when there is no next sticky item.
Useful? React with 👍 / 👎.
fixes: #400
v2 -> #401
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-02-20.at.16.58.02.mov