Skip to content

Commit

Permalink
fix: app crash due to filtering (from more to less)
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Sep 6, 2021
1 parent 963b8d3 commit f31007e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chatty-melons-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-cool-virtual": patch
---

fix: app crash due to filtering (from more to less)
2 changes: 1 addition & 1 deletion src/useVirtual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default <

if (hasDynamicSizeRef.current) {
while (
vStart < msData.length &&
vStart < msData.length - 1 &&
msData[vStart].start + msData[vStart].size < scrollOffset
)
vStart += 1;
Expand Down

0 comments on commit f31007e

Please sign in to comment.