Skip to content

Commit

Permalink
feat: prevent white screen when scroll is bouncing on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuChencheng committed Aug 11, 2024
1 parent 6c830f6 commit a31a8bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useVirtualList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit a31a8bf

Please sign in to comment.