Skip to content

Commit

Permalink
fix(virtual-core): ensure getTotalSize returns 0 for empty list (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasweng authored Sep 16, 2024
1 parent 280dc3b commit 9f8ac01
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/virtual-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,10 @@ export class Virtualizer<
)
}

return end - this.options.scrollMargin + this.options.paddingEnd
return Math.max(
end - this.options.scrollMargin + this.options.paddingEnd,
0,
)
}

private _scrollToOffset = (
Expand Down

0 comments on commit 9f8ac01

Please sign in to comment.