diff --git a/packages/block-library/src/social-link/edit.js b/packages/block-library/src/social-link/edit.js index d0444b79298e78..e70c66e4580639 100644 --- a/packages/block-library/src/social-link/edit.js +++ b/packages/block-library/src/social-link/edit.js @@ -6,15 +6,11 @@ import clsx from 'clsx'; /** * WordPress dependencies */ -import { DELETE, BACKSPACE } from '@wordpress/keycodes'; -import { useDispatch } from '@wordpress/data'; - import { InspectorControls, URLPopover, URLInput, useBlockProps, - store as blockEditorStore, } from '@wordpress/block-editor'; import { useState } from '@wordpress/element'; import { @@ -36,9 +32,7 @@ const SocialLinkURLPopover = ( { setAttributes, setPopover, popoverAnchor, - clientId, } ) => { - const { removeBlock } = useDispatch( blockEditorStore ); return ( { - if ( - !! url || - event.defaultPrevented || - ! [ BACKSPACE, DELETE ].includes( - event.keyCode - ) - ) { - return; - } - removeBlock( clientId ); - } } />