From 45d9b604b877b1ae9eb94d0cb037d82dda73eb89 Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:36:14 +1000 Subject: [PATCH] Patterns: Prevent convert modal closing block options menu (#53707) --- packages/patterns/src/components/index.js | 3 +-- .../patterns/src/components/pattern-convert-button.js | 10 +--------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/patterns/src/components/index.js b/packages/patterns/src/components/index.js index 755b5f3556ee5..a00d2d2bd262e 100644 --- a/packages/patterns/src/components/index.js +++ b/packages/patterns/src/components/index.js @@ -12,12 +12,11 @@ import PatternsManageButton from './patterns-manage-button'; export default function PatternsMenuItems( { rootClientId } ) { return ( - { ( { onClose, selectedClientIds } ) => ( + { ( { selectedClientIds } ) => ( <> { selectedClientIds.length === 1 && ( void} props.onClose Callback to close the menu. * @return {import('@wordpress/element').WPComponent} The menu control or null. */ -export default function PatternConvertButton( { - clientIds, - rootClientId, - onClose, -} ) { +export default function PatternConvertButton( { clientIds, rootClientId } ) { const { createSuccessNotice } = useDispatch( noticesStore ); const [ isModalOpen, setIsModalOpen ] = useState( false ); const canConvert = useSelect( @@ -114,15 +109,12 @@ export default function PatternConvertButton( { clientIds={ clientIds } onSuccess={ ( pattern ) => { handleSuccess( pattern ); - onClose(); } } onError={ () => { setIsModalOpen( false ); - onClose(); } } onClose={ () => { setIsModalOpen( false ); - onClose(); } } /> ) }