🐛 Fix(custom): fix gallery scroll bug

This commit is contained in:
Kuingsmile
2025-11-14 14:53:29 +08:00
parent 30b54cbe10
commit 264fbbfdd8
2 changed files with 33 additions and 6 deletions

View File

@@ -94,6 +94,16 @@ export function useVirtualGrid(options: UseVirtualGridOptions) {
}
})
watch(
() => items.value.length,
() => {
const { totalHeight } = gridCalculations.value
if (scrollTop.value > totalHeight - containerHeight.value) {
scrollTop.value = Math.max(0, totalHeight - containerHeight.value)
}
}
)
return {
gridCalculations,
visibleIndexes,