mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-06 20:10:12 +02:00
prevent render null items in grid
This commit is contained in:
@@ -404,6 +404,7 @@ const ListComponent = memo((props: ListChildComponentProps<GridItemProps>) => {
|
||||
}
|
||||
|
||||
for (let i = startIndex; i <= stopIndex + columnCountToAdd; i += 1) {
|
||||
if (i < data.length) {
|
||||
items.push(
|
||||
<div
|
||||
className={clsx(styles.itemRow, styles[`gap-${gap}`])}
|
||||
@@ -413,6 +414,9 @@ const ListComponent = memo((props: ListChildComponentProps<GridItemProps>) => {
|
||||
<ItemCard controls={controls} data={data[i]} itemType={itemType} withControls />
|
||||
</div>,
|
||||
);
|
||||
} else {
|
||||
items.push(null);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user