Skip to content

Commit

Permalink
Providing a default value for split gap values, where one is `undefin…
Browse files Browse the repository at this point in the history
…ed`.
  • Loading branch information
ramonjd committed Feb 15, 2022
1 parent 438c7d3 commit 86658be
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/block-editor/src/hooks/gap.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ export function GapEdit( props ) {
const onChange = ( next ) => {
let newValue = next;
if ( typeof next === 'object' ) {
const row = next?.top;
const column = next?.left;
const row = next?.top || 0;
const column = next?.left || 0;
newValue = row === column ? row : `${ row } ${ column }`;
}
const newStyle = {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/columns/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
},
"spacing": {
"blockGap": true,
"blockGap": [ "vertical", "horizontal" ],
"margin": [ "top", "bottom" ],
"padding": true,
"__experimentalDefaultControls": {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}
},
"spacing": {
"blockGap": true,
"blockGap": [ "vertical", "horizontal" ],
"units": [ "px", "em", "rem", "vh", "vw" ],
"__experimentalDefaultControls": {
"blockGap": true
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/social-links/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}
},
"spacing": {
"blockGap": true,
"blockGap": [ "vertical", "horizontal" ],
"margin": [ "top", "bottom" ],
"units": [ "px", "em", "rem", "vh", "vw" ],
"__experimentalDefaultControls": {
Expand Down

0 comments on commit 86658be

Please sign in to comment.