Skip to content

Commit eeb366a

Browse files
ellatrixpriethor
authored andcommitted
Drag: hide block tools popovers (#73539)
Co-authored-by: ellatrix <[email protected]> Co-authored-by: priethor <[email protected]>
1 parent 4073da3 commit eeb366a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

packages/block-editor/src/components/block-tools/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* External dependencies
3+
*/
4+
import clsx from 'clsx';
5+
16
/**
27
* WordPress dependencies
38
*/
@@ -252,7 +257,15 @@ export default function BlockTools( {
252257

253258
return (
254259
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
255-
<div { ...props } onKeyDown={ onKeyDown }>
260+
<div
261+
{ ...props }
262+
onKeyDown={ onKeyDown }
263+
// Popover slots cannot be unmounted during dragging because the
264+
// will just be rendered in a fallback popover slot instead.
265+
className={ clsx( props.className, {
266+
'block-editor-block-tools--is-dragging': isDragging,
267+
} ) }
268+
>
256269
<InsertionPointOpenRef.Provider value={ useRef( false ) }>
257270
{ ! isTyping && ! isZoomOutMode && (
258271
<InsertionPoint

packages/block-editor/src/components/block-tools/style.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,7 @@
206206
top: 50%;
207207
left: 50%;
208208
}
209+
210+
.block-editor-block-tools--is-dragging > .popover-slot {
211+
display: none;
212+
}

0 commit comments

Comments
 (0)