Skip to content

Commit

Permalink
Widget Editor: Don't close the inserter when focusing outside it
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Dec 19, 2024
1 parent 030c680 commit 9ebf0e8
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -25,19 +22,10 @@ export default function InserterSidebar() {
return setIsInserterOpened( false );
}, [ setIsInserterOpened ] );

const [ inserterDialogRef, inserterDialogProps ] = useDialog( {
onClose: closeInserter,
focusOnMount: true,
} );

const libraryRef = useRef();

return (
<div
ref={ inserterDialogRef }
{ ...inserterDialogProps }
className="edit-widgets-layout__inserter-panel"
>
<div className="edit-widgets-layout__inserter-panel">
<div className="edit-widgets-layout__inserter-panel-content">
<Library
showInserterHelpPanel
Expand Down

0 comments on commit 9ebf0e8

Please sign in to comment.