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:
parent
82a3537f86
commit
3c4b1522f2
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Reference in New Issue