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: ffab6a0e9d
ℹ️ 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}`); |
There was a problem hiding this comment.
Reset stale next sticky position for terminal sticky headers
This branch only updates containerStickyNextPosition when a following sticky index exists, so containers that become the last sticky header keep their old next value. After sticky-index/data changes (for example a list going from [0,10,20] to [0,10]), PositionViewSticky still sees a next position and applies push behavior, which can incorrectly push the final sticky header off-screen even though there is no successor. Clearing containerStickyNextPosition in the non-successor case avoids this stale state.
Useful? React with 👍 / 👎.
fixes: #400
v3 -> #402
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-02-20.at.16.00.07.mov