Skip to content

Commit

Permalink
Add check for className (fixes #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpost committed Feb 8, 2020
1 parent 342f1e2 commit 65c8fb3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/layout-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,13 @@ const addProps = ( props, blockType, { columns, showColumnsOnMobile } ) => {
return props;
}

const className = classnames( `wp-block-list--${ columns }-columns`, {
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, {
Expand Down

0 comments on commit 65c8fb3

Please sign in to comment.