From ac1bbadb47308ffd0e1ffea7f0a7a91f254b9a0e Mon Sep 17 00:00:00 2001 From: Ella Date: Thu, 9 May 2024 12:11:50 +0900 Subject: [PATCH] Reset insertion point on block order change --- .../src/components/block-tools/zoom-out-mode-inserters.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 acaff48dd8a30c..5feefbf70d791c 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 @@ -40,6 +40,12 @@ function ZoomOutModeInserters() { }; }, [] ); + useEffect( () => { + // reset insertion point when the block order changes + setInserterIsOpened( true ); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ blockOrder ] ); + // Defer the initial rendering to avoid the jumps due to the animation. useEffect( () => { const timeout = setTimeout( () => {