Skip to content

Commit e4c5e04

Browse files
authored
Update gap when rowGap or columnGap is not specified (#6561)
**Problem:** When no separate rowGap or columnGap property is specified, the gap control should update the gap property. **Fix:** Check it in the strategy if a rowGap or columnGap exists, and if not, update the gap property **Manual Tests:** I hereby swear that: - [x] I opened a hydrogen project and it loaded - [x] I could navigate to various routes in Play mode
1 parent 07d1bbd commit e4c5e04

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

editor/src/components/canvas/canvas-strategies/strategies/set-grid-gap-strategy.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,17 @@ export const setGridGapStrategy: CanvasStrategyFactory = (
164164
return emptyStrategyApplicationResult
165165
}
166166

167+
const shouldSetGapByAxis = gridGap.row.value != null || gridGap.column.value != null
168+
167169
const axis = interactionSession.activeControl.axis
168170
const shouldTearOffGapByAxis = axis === 'row' ? shouldTearOffGap.y : shouldTearOffGap.x
169-
const axisStyleProp = axis === 'row' ? StyleRowGapProp : StyleColumnGapProp
171+
172+
const axisStyleProp = shouldSetGapByAxis
173+
? axis === 'row'
174+
? StyleRowGapProp
175+
: StyleColumnGapProp
176+
: StyleGapProp
177+
170178
const gridGapMeasurement =
171179
axis === 'row' ? updatedGridGapMeasurement.row : updatedGridGapMeasurement.column
172180

0 commit comments

Comments
 (0)