Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Nov 10, 2021
1 parent 0e72980 commit 1162aba
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions packages/block-editor/src/hooks/gap.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,22 @@ export function GapEdit( props ) {
}
};

const blockGapValue = style?.spacing?.blockGap;
const rowValue = blockGapValue?.row;
const columnValue = blockGapValue?.column;
// Check for blockGap string values, e.g., "blockGap":"169px", on pre-axial blocks.
const isStringValue = typeof blockGapValue === 'string';

const boxValues = {
top: style?.spacing?.blockGap?.row,
right: style?.spacing?.blockGap?.column,
bottom: style?.spacing?.blockGap?.row,
left: style?.spacing?.blockGap?.column,
top: isStringValue ? blockGapValue : rowValue,
right: isStringValue ? blockGapValue : columnValue,
bottom: isStringValue ? blockGapValue : rowValue,
left: isStringValue ? blockGapValue : columnValue,
};

// The default combined value we'll take from row.
const defaultValue = boxValues.top;

return Platform.select( {
web: (
<>
Expand All @@ -168,7 +177,7 @@ export function GapEdit( props ) {
onChange={ onChange }
units={ units }
// Default to `row` for combined values.
value={ style?.spacing?.blockGap?.row }
value={ defaultValue }
/>
) }
</>
Expand Down

0 comments on commit 1162aba

Please sign in to comment.