Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlockCanvas: Make contentRef property stable #67210

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ _Parameters_
- _props_ `Object`: Component props.
- _props.height_ `string`: Canvas height, defaults to 300px.
- _props.styles_ `Array`: Content styles to inject into the iframe.
- _props.contentRef_ `Object`: Reference to the content element.
- _props.children_ `Element`: Content of the canvas, defaults to the BlockList component.

_Returns_
Expand Down
19 changes: 12 additions & 7 deletions packages/block-editor/src/components/block-canvas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,20 @@ export function ExperimentalBlockCanvas( {
* }
* ```
*
* @param {Object} props Component props.
* @param {string} props.height Canvas height, defaults to 300px.
* @param {Array} props.styles Content styles to inject into the iframe.
* @param {Element} props.children Content of the canvas, defaults to the BlockList component.
* @return {Element} Block Breadcrumb.
* @param {Object} props Component props.
* @param {string} props.height Canvas height, defaults to 300px.
* @param {Array} props.styles Content styles to inject into the iframe.
* @param {Object} props.contentRef Reference to the content element.
* @param {Element} props.children Content of the canvas, defaults to the BlockList component.
* @return {Element} Block Breadcrumb.
*/
function BlockCanvas( { children, height, styles } ) {
function BlockCanvas( { children, height, styles, contentRef } ) {
return (
<ExperimentalBlockCanvas height={ height } styles={ styles }>
<ExperimentalBlockCanvas
height={ height }
styles={ styles }
contentRef={ contentRef }
>
{ children }
</ExperimentalBlockCanvas>
);
Expand Down
Loading