diff --git a/packages/block-library/src/index.js b/packages/block-library/src/index.js index 718e83a0bf8e8d..72ba6486407266 100644 --- a/packages/block-library/src/index.js +++ b/packages/block-library/src/index.js @@ -9,11 +9,17 @@ import { registerBlockType, store as blocksStore, } from '@wordpress/blocks'; +import { useDisabled } from '@wordpress/compose'; import { select } from '@wordpress/data'; import { useBlockProps } from '@wordpress/block-editor'; import { useServerSideRender } from '@wordpress/server-side-render'; import { __, sprintf } from '@wordpress/i18n'; +/** + * Internal dependencies + */ +import HtmlRenderer from './utils/html-renderer'; + /** * Internal dependencies */ @@ -351,7 +357,8 @@ export const registerCoreBlocks = ( apiVersion: 3, } ), edit: function Edit( { attributes } ) { - const blockProps = useBlockProps(); + const disabledRef = useDisabled(); + const blockProps = useBlockProps( { ref: disabledRef } ); const { content, status, error } = useServerSideRender( { block: blockName, attributes, @@ -376,11 +383,9 @@ export const registerCoreBlocks = ( } return ( -
); }, diff --git a/packages/block-library/src/utils/html-renderer.js b/packages/block-library/src/utils/html-renderer.js index b6cb42e3ade565..6bb5b538d4a5cf 100644 --- a/packages/block-library/src/utils/html-renderer.js +++ b/packages/block-library/src/utils/html-renderer.js @@ -1,6 +1,7 @@ /** * External dependencies */ +import clsx from 'clsx'; import parse, { attributesToProps, domToReact } from 'html-react-parser'; /** @@ -26,6 +27,10 @@ const HtmlRenderer = ( { wrapperProps = {}, html = '' } ) => { const mergedProps = { ...parsedProps, ...wrapperProps, + className: clsx( + parsedProps.className, + wrapperProps.className + ), }; return (