From a31a8bfb79ec02630a754e438f4e6b8ca2479fbf Mon Sep 17 00:00:00 2001 From: ChuChencheng Date: Sun, 11 Aug 2024 16:28:53 +0800 Subject: [PATCH] feat: prevent white screen when scroll is bouncing on mobile devices --- src/hooks/useVirtualList.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useVirtualList.ts b/src/hooks/useVirtualList.ts index e5f8a83..95884ee 100644 --- a/src/hooks/useVirtualList.ts +++ b/src/hooks/useVirtualList.ts @@ -49,7 +49,7 @@ export const useVirtualList = (nonReactive: INonReactiveData, props: IUseVirtual */ const updateRenderNodes = (isScroll: boolean = false): void => { if (blockLength.value > renderAmount.value) { - const scrollTop = scrollArea.value.scrollTop + const scrollTop = Math.max(scrollArea.value.scrollTop, 0) /** 当前滚动了多少节点 */ const scrollNodeAmount = Math.floor(scrollTop / props.nodeMinHeight) renderStart.value =