Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/block-library/src/cover/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
useInnerBlocksProps,
__experimentalUseGradient,
store as blockEditorStore,
useBlockEditingMode,
} from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';
import { useSelect, useDispatch } from '@wordpress/data';
Expand Down Expand Up @@ -278,6 +279,9 @@ function CoverEdit( {
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;

const blockEditingMode = useBlockEditingMode();
const hasNonContentControls = blockEditingMode === 'default';

const [ resizeListener, { height, width } ] = useResizeObserver();
const resizableBoxDimensions = useMemo( () => {
return {
Expand Down Expand Up @@ -447,7 +451,7 @@ function CoverEdit( {
<>
{ blockControls }
{ inspectorControls }
{ isSelected && (
{ hasNonContentControls && isSelected && (
<ResizableCoverPopover { ...resizableCoverProps } />
) }
<TagName
Expand Down Expand Up @@ -576,7 +580,7 @@ function CoverEdit( {
/>
<div { ...innerBlocksProps } />
</TagName>
{ isSelected && (
{ hasNonContentControls && isSelected && (
<ResizableCoverPopover { ...resizableCoverProps } />
) }
</>
Expand Down