修复Grid布局下滑回弹过程列表项数量显示不对

This commit is contained in:
ThinkDifferent 2025-05-24 11:29:12 +08:00 committed by GitHub
parent a7834bcf15
commit 87dd074aec
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) 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 const endIdx = endRow * num
// 只返回区间节点的布局属性 // 只返回区间节点的布局属性