Skip to content

Commit

Permalink
withFontSizes: Parse units into a numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Jul 26, 2021
1 parent e0de351 commit dcd67bd
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ export default ( ...fontSizeNames ) => {
fontSizeAttributeName,
customFontSizeAttributeName
) {
return ( fontSizeValue ) => {
return ( fontSizeUnit ) => {
const fontSizeValue = fontSizeUnit
? parseInt( fontSizeUnit, 10 )
: undefined;
const fontSizeObject = find( this.props.fontSizes, {
size: Number( fontSizeValue ),
size: fontSizeValue,
} );
this.props.setAttributes( {
[ fontSizeAttributeName ]:
Expand Down

0 comments on commit dcd67bd

Please sign in to comment.