Skip to content

Commit

Permalink
Update gap when rowGap or columnGap is not specified (#6561)
Browse files Browse the repository at this point in the history
**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
  • Loading branch information
gbalint authored Oct 18, 2024
1 parent 07d1bbd commit e4c5e04
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e4c5e04

Please sign in to comment.