Skip to content

Commit b27dfa8

Browse files
authored
Fix grid resize striped area length with per-axis gap (#6563)
**Problem:** When changing the grid gap via the canvas the row/column specific gap is set (or using the split gap in the inspector), but it's not taken into account when calculating the striped area length for grid resize. **Fix:** Take the `rowGap` / `columnGap` props into account when calculating the striped area length in addition to the `gap` shorthand. Fixes #6562
1 parent e4c5e04 commit b27dfa8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

editor/src/components/canvas/controls/grid-controls.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,8 @@ export const GridRowColumnResizingControlsComponent = ({
532532
gap={grid.columnGap ?? grid.gap}
533533
padding={grid.padding}
534534
stripedAreaLength={
535-
getStripedAreaLength(grid.gridTemplateRows, grid.gap ?? 0) ?? grid.frame.height
535+
getStripedAreaLength(grid.gridTemplateRows, grid.rowGap ?? grid.gap ?? 0) ??
536+
grid.frame.height
536537
}
537538
alignContent={grid.justifyContent}
538539
justifyContent={grid.alignContent}
@@ -550,7 +551,8 @@ export const GridRowColumnResizingControlsComponent = ({
550551
gap={grid.rowGap ?? grid.gap}
551552
padding={grid.padding}
552553
stripedAreaLength={
553-
getStripedAreaLength(grid.gridTemplateColumns, grid.gap ?? 0) ?? grid.frame.width
554+
getStripedAreaLength(grid.gridTemplateColumns, grid.columnGap ?? grid.gap ?? 0) ??
555+
grid.frame.width
554556
}
555557
alignContent={grid.alignContent}
556558
justifyContent={grid.justifyContent}

0 commit comments

Comments
 (0)