Skip to content

Commit d2eeec7

Browse files
authored
useVirtualList动态高度时BUG修复 (#1410)
1 parent e326b15 commit d2eeec7

File tree

1 file changed

+2
-2
lines changed
  • packages/hooks/src/useVirtualList

1 file changed

+2
-2
lines changed

packages/hooks/src/useVirtualList/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ const useVirtualList = <T = any>(list: T[], options: Options<T>) => {
3434
for (let i = fromIndex; i < list.length; i++) {
3535
const height = itemHeightRef.current(i, list[i]);
3636
sum += height;
37+
endIndex = i;
3738
if (sum >= containerHeight) {
38-
endIndex = i;
39-
break;
39+
break;
4040
}
4141
}
4242
return endIndex - fromIndex;

0 commit comments

Comments
 (0)