Skip to content

Commit

Permalink
fix: snpm jump issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuever committed Dec 3, 2024
1 parent 4c37ad5 commit 5a1b299
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/react-native/src/masonryList/types/masonryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ export type SpaceItemProps<ItemT extends GenericItemT = GenericItemT> = {
export type ColumnDimensionInfo = {
width: number;
left: number;
right: number;
};
2 changes: 2 additions & 0 deletions packages/react/src/lib/masonryList/MasonryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const MasonryList = <ItemT extends GenericItemT>(
const current = {
width: getColumnWidth?.(index) || nextWidth / column,
left: 0,
right: nextWidth - (getColumnWidth?.(index) || nextWidth / column),
};
if (!index) {
acc.push(current);
Expand All @@ -44,6 +45,7 @@ export const MasonryList = <ItemT extends GenericItemT>(
const last = acc[acc.length - 1];
if (last) {
current.left = last.left + last.width;
current.right = nextWidth - current.left - last.width;
}
acc.push(current);
return acc;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/lib/masonryList/RecycleItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const RecycleItem = <ItemT extends GenericItemT>(
// left: 0,
width: columnDimension.width,
left: columnDimension.left,
right: 0,
right: columnDimension.right,
};
return {};
}, [offset, columnDimension]);
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/lib/masonryList/types/masonryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ export type SpaceItemProps<ItemT extends GenericItemT = GenericItemT> = {
export type ColumnDimensionInfo = {
width: number;
left: number;
right: number;
};

0 comments on commit 5a1b299

Please sign in to comment.