Skip to content

Commit

Permalink
Only use a NavigableRegion when the Meta Boxes area is visible.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Nov 22, 2024
1 parent 34e5485 commit 7d9d113
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,11 @@ function MetaBoxesMain( { isLegacy } ) {
}
};
const className = 'edit-post-meta-boxes-main';
const paneLabel = __( 'Meta Boxes' );
const paneLabel = hasAnyVisible ? __( 'Meta Boxes' ) : undefined;
let Pane, paneProps;
if ( isShort ) {
Pane = NavigableRegion;
// Only use a NavigableRegion when the Meta Boxes area is visible.
Pane = hasAnyVisible ? NavigableRegion : 'div';
paneProps = {
className: clsx(
className,
Expand All @@ -286,7 +287,8 @@ function MetaBoxesMain( { isLegacy } ) {
} else {
Pane = ResizableBox;
paneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {
as: NavigableRegion,
// Only use a NavigableRegion when the Meta Boxes area is visible.
as: hasAnyVisible ? NavigableRegion : 'div',
ref: metaBoxesMainRef,
className: clsx(
className,
Expand Down

0 comments on commit 7d9d113

Please sign in to comment.