Skip to content

Commit

Permalink
Post Template: Add missing 'wp-block-post' class in the editor (#40010)
Browse files Browse the repository at this point in the history
* Post Template: Add missing 'wp-block-post' class in the editor
* Apply class to innerBlocks
  • Loading branch information
Mamaduka authored Apr 5, 2022
1 parent ee2550b commit f1cfc3b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/block-library/src/post-template/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const TEMPLATE = [
];

function PostTemplateInnerBlocks() {
const innerBlocksProps = useInnerBlocksProps( {}, { template: TEMPLATE } );
const innerBlocksProps = useInnerBlocksProps(
{ className: 'wp-block-post' },
{ template: TEMPLATE }
);
return <li { ...innerBlocksProps } />;
}

Expand All @@ -38,6 +41,9 @@ function PostTemplateBlockPreview( {
} ) {
const blockPreviewProps = useBlockPreview( {
blocks,
props: {
className: 'wp-block-post',
},
} );

const handleOnClick = () => {
Expand Down

0 comments on commit f1cfc3b

Please sign in to comment.