Skip to content

Commit

Permalink
Revert change that removes the social link block when pressing backsp…
Browse files Browse the repository at this point in the history
…ace in the URL Popover (#61344)

Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: alexstine <alexstine@git.wordpress.org>
  • Loading branch information
4 people authored and ellatrix committed Jun 18, 2024
1 parent 2bb7aa6 commit f67cfde
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions packages/block-library/src/social-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -36,9 +32,7 @@ const SocialLinkURLPopover = ( {
setAttributes,
setPopover,
popoverAnchor,
clientId,
} ) => {
const { removeBlock } = useDispatch( blockEditorStore );
return (
<URLPopover
anchor={ popoverAnchor }
Expand All @@ -62,18 +56,6 @@ const SocialLinkURLPopover = ( {
label={ __( 'Enter social link' ) }
hideLabelFromVision
disableSuggestions
onKeyDown={ ( event ) => {
if (
!! url ||
event.defaultPrevented ||
! [ BACKSPACE, DELETE ].includes(
event.keyCode
)
) {
return;
}
removeBlock( clientId );
} }
/>
</div>
<Button
Expand All @@ -91,7 +73,6 @@ const SocialLinkEdit = ( {
context,
isSelected,
setAttributes,
clientId,
} ) => {
const { url, service, label = '', rel } = attributes;
const {
Expand Down Expand Up @@ -178,7 +159,6 @@ const SocialLinkEdit = ( {
setAttributes={ setAttributes }
setPopover={ setPopover }
popoverAnchor={ popoverAnchor }
clientId={ clientId }
/>
) }
</li>
Expand Down

1 comment on commit f67cfde

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in f67cfde.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9560842976
📝 Reported issues:

Please sign in to comment.