Skip to content

Commit

Permalink
Fixes broken columns
Browse files Browse the repository at this point in the history
See: #5.
  • Loading branch information
Mamaduka committed Mar 27, 2020
1 parent f6050c0 commit 95afa2f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/layout-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,16 @@ const addProps = ( props, blockType, { columns, showColumnsOnMobile } ) => {
return props;
}

if ( typeof props.className === 'undefined' || ! props.className ) {
return props;
}

const className = classnames( {
'wp-block-list--show-columns-on-mobile': showColumnsOnMobile,
[ `wp-block-list--${ columns }-columns` ]: Number( columns ) > 1,
} );

return assign( props, {
class: className,
} );
if ( ! className ) {
return props;
}

return assign( props, { className } );
};

export default () => {
Expand Down

0 comments on commit 95afa2f

Please sign in to comment.