File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/block-library/src/image Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -116,9 +116,9 @@ export function ImageEdit( {
116116 // Only observe the max width from the parent container when the parent layout is not flex nor grid.
117117 // This won't work for them because the container width changes with the image.
118118 // TODO: Find a way to observe the container width for flex and grid layouts.
119+ const layoutType = parentLayout ?. type || parentLayout ?. default ?. type ;
119120 const isMaxWidthContainerWidth =
120- ! parentLayout ||
121- ( parentLayout . type !== 'flex' && parentLayout . type !== 'grid' ) ;
121+ ! layoutType || ( layoutType !== 'flex' && layoutType !== 'grid' ) ;
122122 const [ maxWidthObserver , maxContentWidth ] = useMaxWidthObserver ( ) ;
123123
124124 const [ placeholderResizeListener , { width : placeholderWidth } ] =
@@ -452,7 +452,7 @@ export function ImageEdit( {
452452 context = { context }
453453 clientId = { clientId }
454454 blockEditingMode = { blockEditingMode }
455- parentLayoutType = { parentLayout ?. type }
455+ parentLayoutType = { layoutType }
456456 maxContentWidth = { maxContentWidth }
457457 />
458458 < MediaPlaceholder
You can’t perform that action at this time.
0 commit comments