From 854756a8b51e8e0ed5c9b705cae8c5bf1fa51457 Mon Sep 17 00:00:00 2001 From: Andrei Draganescu Date: Mon, 22 Apr 2024 10:18:06 +0300 Subject: [PATCH] make the zoom out inserters work for sections inside the section root (#60909) --- .../src/components/block-tools/zoom-out-mode-inserters.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/block-tools/zoom-out-mode-inserters.js b/packages/block-editor/src/components/block-tools/zoom-out-mode-inserters.js index 3c42bdcdb4a48d..e3d411d07f7260 100644 --- a/packages/block-editor/src/components/block-tools/zoom-out-mode-inserters.js +++ b/packages/block-editor/src/components/block-tools/zoom-out-mode-inserters.js @@ -10,11 +10,15 @@ import { useEffect, useState } from '@wordpress/element'; import BlockPopoverInbetween from '../block-popover/inbetween'; import { store as blockEditorStore } from '../../store'; import Inserter from '../inserter'; +import { unlock } from '../../lock-unlock'; function ZoomOutModeInserters( { __unstableContentRef } ) { const [ isReady, setIsReady ] = useState( false ); const blockOrder = useSelect( ( select ) => { - return select( blockEditorStore ).getBlockOrder(); + const { sectionRootClientId } = unlock( + select( blockEditorStore ).getSettings() + ); + return select( blockEditorStore ).getBlockOrder( sectionRootClientId ); }, [] ); // Defer the initial rendering to avoid the jumps due to the animation.