Skip to content

Commit cf80203

Browse files
im3dabasiaim3dabasiamichalczaplinskiellatrixdsas
authored
Fix: Update viewportWidth of BlockPreview to better align with core breakpoints (#67097)
Ensured the Media & Text block displays components side by side in the preview, even on larger devices. The preview container was previously too small, causing the elements to stack. This change ensures the components remain properly aligned in the preview. Co-authored-by: im3dabasia <[email protected]> Co-authored-by: michalczaplinski <[email protected]> Co-authored-by: ellatrix <[email protected]> Co-authored-by: dsas <[email protected]> Co-authored-by: fabiankaegy <[email protected]>
1 parent 1c698f8 commit cf80203

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/block-editor/src/components/block-switcher/preview-block-popover.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default function PreviewBlockPopover( { blocks } ) {
2929
<div className="block-editor-block-switcher__preview-title">
3030
{ __( 'Preview' ) }
3131
</div>
32-
<BlockPreview viewportWidth={ 500 } blocks={ blocks } />
32+
{ /* 600px is the value of $break-small in base-styles/_breakpoints.scss.
33+
We set the viewport width to 601px to make sure that the media-text
34+
block which uses this breakpoint has the correct padding. */ }
35+
<BlockPreview viewportWidth={ 601 } blocks={ blocks } />
3336
</div>
3437
</Popover>
3538
</div>

0 commit comments

Comments
 (0)