Skip to content

Commit

Permalink
Merge pull request #104 from wsfe/feat/mobile-scroll-bouncing
Browse files Browse the repository at this point in the history
feat: prevent white screen when scroll is bouncing on mobile devices
  • Loading branch information
ChuChencheng authored Sep 21, 2024
2 parents 6c830f6 + a31a8bf commit 27f87ac
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 27f87ac

Please sign in to comment.