Skip to content

Commit

Permalink
fix: correct the high of bindary-search for finding the item index fr…
Browse files Browse the repository at this point in the history
…om scroll
  • Loading branch information
wellyshen committed May 28, 2021
1 parent d155b69 commit bf7d25b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/orange-dolls-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-cool-virtual": patch
---

fix: correct the high of bindary-search for finding the item index from scroll
2 changes: 1 addition & 1 deletion src/useVirtual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default <
} else {
vStart = findNearestBinarySearch(
0,
msData.length,
msData.length - 1,
scrollOffset,
(idx) => msData[idx].start
);
Expand Down

0 comments on commit bf7d25b

Please sign in to comment.