Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Mar 17, 2021
1 parent d25f7e8 commit 1cdad33
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default function useBlockDropZone( {

const dropEventHandlers = useOnBlockDrop();

const { position } = useDropZone( {
const { position, isDraggingOverDocument } = useDropZone( {
element,
isDisabled: isLockedAll,
withPosition: true,
Expand All @@ -141,10 +141,10 @@ export default function useBlockDropZone( {
}, [ position ] );

useEffect( () => {
if ( targetBlockIndex !== null ) {
showInsertionPoint( targetRootClientId, targetBlockIndex );
} else {
if ( ! isDraggingOverDocument ) {
hideInsertionPoint();
} else if ( targetBlockIndex !== null ) {
showInsertionPoint( targetRootClientId, targetBlockIndex );
}
}, [ targetBlockIndex ] );
}, [ targetBlockIndex, isDraggingOverDocument ] );
}

0 comments on commit 1cdad33

Please sign in to comment.