Skip to content

Commit

Permalink
Hide Zoom Out inserter buttons when dragging (WordPress#65789)
Browse files Browse the repository at this point in the history
Co-authored-by: getdave <get_dave@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>
  • Loading branch information
4 people authored and huubl committed Oct 2, 2024
1 parent 9bd9bd6 commit 9a16053
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/block-editor/src/components/block-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function selector( select ) {
getSettings,
__unstableGetEditorMode,
isTyping,
} = select( blockEditorStore );
isDragging,
} = unlock( select( blockEditorStore ) );

const clientId =
getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
Expand All @@ -46,6 +47,7 @@ function selector( select ) {
hasFixedToolbar: getSettings().hasFixedToolbar,
isTyping: isTyping(),
isZoomOutMode: editorMode === 'zoom-out',
isDragging: isDragging(),
};
}

Expand All @@ -63,10 +65,9 @@ export default function BlockTools( {
__unstableContentRef,
...props
} ) {
const { clientId, hasFixedToolbar, isTyping, isZoomOutMode } = useSelect(
selector,
[]
);
const { clientId, hasFixedToolbar, isTyping, isZoomOutMode, isDragging } =
useSelect( selector, [] );

const isMatch = useShortcutEventMatch();
const {
getBlocksByClientId,
Expand Down Expand Up @@ -241,7 +242,7 @@ export default function BlockTools( {
name="__unstable-block-tools-after"
ref={ blockToolbarAfterRef }
/>
{ isZoomOutMode && (
{ isZoomOutMode && ! isDragging && (
<ZoomOutModeInserters
__unstableContentRef={ __unstableContentRef }
/>
Expand Down

0 comments on commit 9a16053

Please sign in to comment.