diff --git a/packages/block-editor/src/components/block-popover/inbetween.js b/packages/block-editor/src/components/block-popover/inbetween.js index a585e9f1172e97..40b819f1592975 100644 --- a/packages/block-editor/src/components/block-popover/inbetween.js +++ b/packages/block-editor/src/components/block-popover/inbetween.js @@ -74,9 +74,7 @@ function BlockPopoverInbetween( { if ( isVertical ) { return { - width: previousElement - ? previousElement.offsetWidth - : nextElement.offsetWidth, + width: previousRect ? previousRect.width : nextRect.width, height: nextRect && previousRect ? nextRect.top - previousRect.bottom @@ -93,9 +91,7 @@ function BlockPopoverInbetween( { return { width, - height: previousElement - ? previousElement.offsetHeight - : nextElement.offsetHeight, + height: previousRect ? previousRect.height : nextRect.height, }; }, [ previousElement, nextElement, isVertical, positionRecompute ] ); @@ -183,6 +179,7 @@ function BlockPopoverInbetween( { 'block-editor-block-popover', props.className ) } + __unstableForcePosition >