From 0a1cab36c5383b62274367d141a6e267b9e0e688 Mon Sep 17 00:00:00 2001 From: Balint Gabor <127662+gbalint@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:34:08 +0200 Subject: [PATCH] Update gap when rowGap or columnGap is not specified --- .../strategies/set-grid-gap-strategy.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/editor/src/components/canvas/canvas-strategies/strategies/set-grid-gap-strategy.tsx b/editor/src/components/canvas/canvas-strategies/strategies/set-grid-gap-strategy.tsx index 9339b388a790..efcba9317cb9 100644 --- a/editor/src/components/canvas/canvas-strategies/strategies/set-grid-gap-strategy.tsx +++ b/editor/src/components/canvas/canvas-strategies/strategies/set-grid-gap-strategy.tsx @@ -164,9 +164,17 @@ export const setGridGapStrategy: CanvasStrategyFactory = ( return emptyStrategyApplicationResult } + const shouldSetGapByAxis = gridGap.row.value != null || gridGap.column.value != null + const axis = interactionSession.activeControl.axis const shouldTearOffGapByAxis = axis === 'row' ? shouldTearOffGap.y : shouldTearOffGap.x - const axisStyleProp = axis === 'row' ? StyleRowGapProp : StyleColumnGapProp + + const axisStyleProp = shouldSetGapByAxis + ? axis === 'row' + ? StyleRowGapProp + : StyleColumnGapProp + : StyleGapProp + const gridGapMeasurement = axis === 'row' ? updatedGridGapMeasurement.row : updatedGridGapMeasurement.column