Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/core/calculateItemsInView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ export function calculateItemsInView(
const currentStickyIdx =
stickyIndicesArr.length > 0 ? findCurrentStickyIndex(stickyIndicesArr, scroll, state) : -1;
const nextActiveStickyIndex = currentStickyIdx >= 0 ? stickyIndicesArr[currentStickyIdx] : undefined;
const stickyIndexDidChange = previousStickyIndex !== nextActiveStickyIndex;
state.activeStickyIndex = nextActiveStickyIndex;

let scrollBufferTop = scrollBuffer;
let scrollBufferBottom = scrollBuffer;

Expand All @@ -213,7 +214,7 @@ export function calculateItemsInView(
const scrollBottomBuffered = scrollBottom + scrollBufferBottom;

// Check precomputed scroll range to see if we can skip this check
if (!dataChanged && scrollForNextCalculateItemsInView) {
if (!dataChanged && !stickyIndexDidChange && scrollForNextCalculateItemsInView) {
const { top, bottom } = scrollForNextCalculateItemsInView;
if (scrollTopBuffered > top && scrollBottomBuffered < bottom) {
return;
Expand Down