From e9981aade7a4b0447ee767c63a36f89b85c47480 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Wed, 8 May 2024 10:54:13 +0900 Subject: [PATCH] Inserter: Don't close when inserting (#61004) * Zoomed Out View: Don't close the inserter Co-authored-by: scruffian Co-authored-by: jeryj Co-authored-by: richtabor Co-authored-by: Mamaduka Co-authored-by: ellatrix Co-authored-by: youknowriad Co-authored-by: jasmussen Co-authored-by: getdave --- .../src/components/inserter-sidebar/index.js | 16 ++-------------- .../editor/various/inserting-blocks.spec.js | 4 ++-- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/packages/editor/src/components/inserter-sidebar/index.js b/packages/editor/src/components/inserter-sidebar/index.js index 98292c6662559b..0da3d7cada42c5 100644 --- a/packages/editor/src/components/inserter-sidebar/index.js +++ b/packages/editor/src/components/inserter-sidebar/index.js @@ -5,10 +5,7 @@ import { useDispatch, useSelect } from '@wordpress/data'; import { Button } from '@wordpress/components'; import { __experimentalLibrary as Library } from '@wordpress/block-editor'; import { closeSmall } from '@wordpress/icons'; -import { - useViewportMatch, - __experimentalUseDialog as useDialog, -} from '@wordpress/compose'; +import { useViewportMatch } from '@wordpress/compose'; import { __ } from '@wordpress/i18n'; import { useRef } from '@wordpress/element'; import { store as preferencesStore } from '@wordpress/preferences'; @@ -34,19 +31,10 @@ export default function InserterSidebar( { const { setIsInserterOpened } = useDispatch( editorStore ); const isMobileViewport = useViewportMatch( 'medium', '<' ); - const [ inserterDialogRef, inserterDialogProps ] = useDialog( { - onClose: () => setIsInserterOpened( false ), - focusOnMount: true, - } ); - const libraryRef = useRef(); return ( -
+