Skip to content

Commit

Permalink
Revert "Resize cover block only in normal mode (WordPress#65731)"
Browse files Browse the repository at this point in the history
This reverts commit d0ed1ce.
  • Loading branch information
huubl authored Oct 2, 2024
1 parent 349bf38 commit 5ce07dd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/block-library/src/cover/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ 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 @@ -279,9 +278,6 @@ 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 @@ -451,7 +447,7 @@ function CoverEdit( {
<>
{ blockControls }
{ inspectorControls }
{ hasNonContentControls && isSelected && (
{ isSelected && (
<ResizableCoverPopover { ...resizableCoverProps } />
) }
<TagName
Expand Down Expand Up @@ -580,7 +576,7 @@ function CoverEdit( {
/>
<div { ...innerBlocksProps } />
</TagName>
{ hasNonContentControls && isSelected && (
{ isSelected && (
<ResizableCoverPopover { ...resizableCoverProps } />
) }
</>
Expand Down

0 comments on commit 5ce07dd

Please sign in to comment.