fix: disable placeholders in waterfall to prevent layout redraws

Disabled placeholder items in picture waterfall to fix bug where
the layout would redraw when reaching the last page, causing
rendered elements to shift positions and degrading user experience.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
DIYgod 2025-07-18 20:06:45 +08:00
parent 82a3537f86
commit 3c4b1522f2
No known key found for this signature in database
1 changed files with 8 additions and 7 deletions

View File

@ -124,13 +124,14 @@ export const PictureMasonry: FC<MasonryProps> = (props) => {
return ret
}) as { entryId: string; cache?: object }[]
if (props.hasNextPage) {
for (let i = 0; i < 10; i++) {
result.push({
entryId: `placeholder${i}`,
})
}
}
// Disable placeholders in waterfall to prevent layout redraws on last page
// if (props.hasNextPage) {
// for (let i = 0; i < 10; i++) {
// result.push({
// entryId: `placeholder${i}`,
// })
// }
// }
return result
}, [cacheMap, data, props.hasNextPage])