Skip to content

Commit

Permalink
Fix bug with Posts with no full width blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave authored and draganescu committed Oct 14, 2024
1 parent dfa04be commit b95d7ef
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/block-editor/src/components/block-popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@ function BlockPopover(
// not full width and nested blocks to keep section height.
if ( isZoomOut && isSectionSelected ) {
// If the rootSectionElement is undefined then recurse up the DOM tree
// to find the element with `is-root-container` classname.
// to find the element with `block-editor-iframe__body` classname.
// This can then be used as the anchor point.
// FIXME: we should not rely on classnames to find the
// root section element
if ( ! rootSectionElement ) {
postRootElement =
selectedElement.closest( '.is-root-container' );
postRootElement = selectedElement.closest(
'.block-editor-iframe__body'
);
}

// Compute the height based on the parent section of the
Expand Down Expand Up @@ -176,11 +177,14 @@ function BlockPopover(
contextElement: selectedElement,
};
}, [
bottomClientId,
lastSelectedElement,
selectedElement,
popoverDimensionsRecomputeCounter,
isZoomOut,
parentSectionElement,
selectedElement,
bottomClientId,
lastSelectedElement,
isSectionSelected,
rootSectionElement,
] );

if ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {
Expand Down

0 comments on commit b95d7ef

Please sign in to comment.