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
commit bfcb19293a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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
// 只返回区间节点的布局属性