From 9ebf0e83691a6d1f458c7fba8d2b6fea5ea52f82 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Thu, 12 Dec 2024 00:04:26 +0900 Subject: [PATCH] Widget Editor: Don't close the inserter when focusing outside it --- .../secondary-sidebar/inserter-sidebar.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/packages/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js b/packages/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js index 72e04e5f62034c..09045dcf2a1a1e 100644 --- a/packages/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js +++ b/packages/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js @@ -2,10 +2,7 @@ * WordPress dependencies */ import { __experimentalLibrary as Library } from '@wordpress/block-editor'; -import { - useViewportMatch, - __experimentalUseDialog as useDialog, -} from '@wordpress/compose'; +import { useViewportMatch } from '@wordpress/compose'; import { useCallback, useRef } from '@wordpress/element'; import { useDispatch } from '@wordpress/data'; @@ -25,19 +22,10 @@ export default function InserterSidebar() { return setIsInserterOpened( false ); }, [ setIsInserterOpened ] ); - const [ inserterDialogRef, inserterDialogProps ] = useDialog( { - onClose: closeInserter, - focusOnMount: true, - } ); - const libraryRef = useRef(); return ( -
+