Skip to content

Commit

Permalink
fix: getItemKey when element is missing from list (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
piecyk authored Aug 23, 2024
1 parent b85e1b8 commit 045b442
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/virtual-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,11 @@ export class Virtualizer<
entry: ResizeObserverEntry | undefined,
) => {
const index = this.indexFromElement(node)
const key = this.options.getItemKey(index)

const item = this.measurementsCache[index]
if (!item) {
return
}
const key = item.key
const prevNode = this.elementsCache.get(key)

if (prevNode !== node) {
Expand Down

0 comments on commit 045b442

Please sign in to comment.