Merge pull request #6 from zhangyuantao/patch-1

修复Grid布局下滑回弹过程列表项数量显示不对
This commit is contained in:
568071718
2025-05-24 12:24:35 +08:00
committed by GitHub
+1 -1
View File
@@ -130,7 +130,7 @@ export class GridLayout extends YXLayout {
let num = this.getMaxItemsPerRow(collectionView)
// 计算索引区间
const startIdx = startRow * num
const startIdx = Math.max(startRow * num, 0) // 防止<0:当列表置顶往下滑时(rect.y < 0)得出startIdx为负数,导致slice截取为空(表现是回弹过程列表元素截断)
const endIdx = endRow * num
// 只返回区间节点的布局属性