Skip to content

Commit

Permalink
fix: numberToBox definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed May 12, 2023
1 parent d6a0de5 commit a2ae025
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/blocks/blocks/flip/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ const Inspector = ({
label={ __( 'Description', 'otter-blocks' ) }
>
<FontSizePicker
value={ numberToBox( attributes.descriptionFontSize ) }
value={ _px( attributes.descriptionFontSize ) }
onChange={ descriptionFontSize => setAttributes({ descriptionFontSize }) }
fontSizes={[ ...defaultFontSizes, { name: '28', size: '28px', slug: '28' }]}
allowReset
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/helpers/helper-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ export const renderBoxOrNumWithUnit = ( box, unit ) => {
* @param {string?} unit The unit to add.
* @returns {import('./blocks').BoxType | any} The box value or given value.
*/
export const numberToBox = ( n, unit = 'px' ) => isNumber( x ) ? stringToBox( _unit( x, unit ) ) : x;
export const numberToBox = ( x, unit = 'px' ) => isNumber( x ) ? stringToBox( _unit( x, unit ) ) : x;

/**
* Return true if platform is MacOS.
Expand Down

0 comments on commit a2ae025

Please sign in to comment.