Skip to content

Commit

Permalink
Clean new style objects after resetting spacing values
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jul 21, 2021
1 parent 63c609b commit 7c988d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/block-editor/src/hooks/margin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function hasMarginSupport( blockType ) {
/**
* Checks if there is a current value in the margin block support attributes.
*
* @param {Object} props Block props.
* @param {Object} props Block props.
* @return {boolean} Whether or not the block has a margin value set.
*/
export function hasMarginValue( props ) {
Expand All @@ -50,13 +50,13 @@ export function resetMargin( { attributes = {}, setAttributes } ) {
const { style } = attributes;

setAttributes( {
style: {
style: cleanEmptyObject( {
...style,
spacing: {
...style?.spacing,
margin: undefined,
},
},
} ),
} );
}

Expand Down
6 changes: 3 additions & 3 deletions packages/block-editor/src/hooks/padding.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function hasPaddingSupport( blockType ) {
/**
* Checks if there is a current value in the padding block support attributes.
*
* @param {Object} props Block props.
* @param {Object} props Block props.
* @return {boolean} Whether or not the block has a padding value set.
*/
export function hasPaddingValue( props ) {
Expand All @@ -50,13 +50,13 @@ export function resetPadding( { attributes = {}, setAttributes } ) {
const { style } = attributes;

setAttributes( {
style: {
style: cleanEmptyObject( {
...style,
spacing: {
...style?.spacing,
padding: undefined,
},
},
} ),
} );
}

Expand Down

0 comments on commit 7c988d6

Please sign in to comment.