Skip to content

Commit

Permalink
useVirtualList动态高度时BUG修复 (#1410)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZengHaiTao1 authored Dec 27, 2021
1 parent e326b15 commit d2eeec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/hooks/src/useVirtualList/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const useVirtualList = <T = any>(list: T[], options: Options<T>) => {
for (let i = fromIndex; i < list.length; i++) {
const height = itemHeightRef.current(i, list[i]);
sum += height;
endIndex = i;
if (sum >= containerHeight) {
endIndex = i;
break;
break;
}
}
return endIndex - fromIndex;
Expand Down

0 comments on commit d2eeec7

Please sign in to comment.