Skip to content

Commit

Permalink
fix: scroll position behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed May 27, 2021
1 parent 3ba8f2b commit 282aeb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cool-worms-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-cool-virtual": patch
---

fix: scroll position behavior
1 change: 0 additions & 1 deletion src/useVirtual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ export default <
const prevEnd = msData[i - 1]?.end || 0;

if (measuredSize !== size || start !== prevEnd) {
msDataRef.current[msData.length - 1].end += measuredSize - size;
msDataRef.current[i] = getMeasure(i, measuredSize);
handleScroll(scrollOffset, isScrolling);
}
Expand Down

0 comments on commit 282aeb0

Please sign in to comment.