diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/toolbar/delete.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/toolbar/delete.tsx index 93746532c84..af3798401dd 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/toolbar/delete.tsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/toolbar/delete.tsx @@ -10,9 +10,15 @@ import { // @ts-expect-error missing type } from '@wordpress/block-editor'; -export default function Delete( { clientId }: { clientId: string } ) { +export default function Delete( { + clientId, + nextBlockClientId, +}: { + clientId: string; + nextBlockClientId: string | undefined; +} ) { // @ts-expect-error missing type - const { removeBlock } = useDispatch( blockEditorStore ); + const { removeBlock, selectBlock } = useDispatch( blockEditorStore ); return ( @@ -22,6 +28,9 @@ export default function Delete( { clientId }: { clientId: string } ) { icon={ trash } onClick={ () => { removeBlock( clientId ); + if ( nextBlockClientId ) { + selectBlock( nextBlockClientId ); + } } } /> diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/toolbar/toolbar.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/toolbar/toolbar.tsx index 6174a2c095c..f7e79e68aa6 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/toolbar/toolbar.tsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/toolbar/toolbar.tsx @@ -144,7 +144,10 @@ export const Toolbar = () => { /> - + diff --git a/plugins/woocommerce/changelog/48316-48251-select-next-block-after-delete b/plugins/woocommerce/changelog/48316-48251-select-next-block-after-delete new file mode 100644 index 00000000000..0929b38d448 --- /dev/null +++ b/plugins/woocommerce/changelog/48316-48251-select-next-block-after-delete @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +CYS - Select the next block after deleting the selected one (instead of the header). \ No newline at end of file