From e7b19b857228190307200b5ae9623d28d253db36 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Tue, 18 Jun 2024 14:31:41 +0800 Subject: [PATCH] Revert change that removes the social link block when pressing backspace in the URL Popover (#61344) Co-authored-by: talldan Co-authored-by: ntsekouras Co-authored-by: alexstine --- .../block-library/src/social-link/edit.js | 20 ------------------- 1 file changed, 20 deletions(-) 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 ); - } } />