From bbb367199e96a5412a5144030f04e07228565400 Mon Sep 17 00:00:00 2001 From: eferinte Date: Wed, 27 Nov 2024 21:42:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20getVisibleCount=E5=9C=A8fromIndex=3D=3D?= =?UTF-8?q?=3Dlist.lenght=E6=97=B6=E5=AF=BC=E8=87=B4endIndex=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=BC=82=E5=B8=B8=EF=BC=8C=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E8=B4=9F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hooks/src/useVirtualList/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hooks/src/useVirtualList/index.ts b/packages/hooks/src/useVirtualList/index.ts index e20f4d7985..02bf62b1a4 100644 --- a/packages/hooks/src/useVirtualList/index.ts +++ b/packages/hooks/src/useVirtualList/index.ts @@ -37,7 +37,7 @@ const useVirtualList = (list: T[], options: Options) => { } let sum = 0; - let endIndex = 0; + let endIndex = fromIndex; for (let i = fromIndex; i < list.length; i++) { const height = itemHeightRef.current(i, list[i]); sum += height;