Skip to content

Commit 1eca9a5

Browse files
committed
chore: rename maxSpace into maxHorizontalSpace
1 parent 344cafe commit 1eca9a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/@react-stately/layout/src/GridLayout.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export interface GridLayoutOptions {
4040
* The maximum allowed horizontal space between items.
4141
* @default Infinity
4242
*/
43-
maxSpace?: number,
43+
maxHorizontalSpace?: number,
4444
/**
4545
* The maximum number of columns.
4646
* @default Infinity
@@ -84,7 +84,7 @@ export class GridLayout<T, O extends GridLayoutOptions = GridLayoutOptions> exte
8484
|| (!(newOptions.minItemSize || DEFAULT_OPTIONS.minItemSize).equals(oldOptions.minItemSize || DEFAULT_OPTIONS.minItemSize))
8585
|| (!(newOptions.maxItemSize || DEFAULT_OPTIONS.maxItemSize).equals(oldOptions.maxItemSize || DEFAULT_OPTIONS.maxItemSize))
8686
|| (!(newOptions.minSpace || DEFAULT_OPTIONS.minSpace).equals(oldOptions.minSpace || DEFAULT_OPTIONS.minSpace))
87-
|| newOptions.maxSpace !== oldOptions.maxSpace;
87+
|| newOptions.maxHorizontalSpace !== oldOptions.maxHorizontalSpace;
8888
}
8989

9090
update(invalidationContext: InvalidationContext<O>): void {
@@ -93,7 +93,7 @@ export class GridLayout<T, O extends GridLayoutOptions = GridLayoutOptions> exte
9393
maxItemSize = DEFAULT_OPTIONS.maxItemSize,
9494
preserveAspectRatio = DEFAULT_OPTIONS.preserveAspectRatio,
9595
minSpace = DEFAULT_OPTIONS.minSpace,
96-
maxSpace = DEFAULT_OPTIONS.maxSpace,
96+
maxHorizontalSpace = DEFAULT_OPTIONS.maxSpace,
9797
maxColumns = DEFAULT_OPTIONS.maxColumns,
9898
dropIndicatorThickness = DEFAULT_OPTIONS.dropIndicatorThickness
9999
} = invalidationContext.layoutOptions || {};
@@ -126,7 +126,7 @@ export class GridLayout<T, O extends GridLayoutOptions = GridLayoutOptions> exte
126126
itemHeight = Math.max(minItemSize.height, Math.min(maxItemHeight, itemHeight));
127127

128128
// Compute the horizontal spacing, content height and horizontal margin
129-
let horizontalSpacing = Math.min(maxSpace, Math.floor((visibleWidth - numColumns * itemWidth) / (numColumns + 1)));
129+
let horizontalSpacing = Math.min(maxHorizontalSpace, Math.floor((visibleWidth - numColumns * itemWidth) / (numColumns + 1)));
130130
this.gap = new Size(horizontalSpacing, minSpace.height);
131131
this.margin = Math.floor((visibleWidth - numColumns * itemWidth - horizontalSpacing * (numColumns + 1)) / 2);
132132

0 commit comments

Comments
 (0)