Skip to content

Commit 3dc1062

Browse files
committed
Fix reset behavior
1 parent f75921b commit 3dc1062

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

  • packages/block-library/src/image

packages/block-library/src/image/image.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,6 @@ export default function Image( {
592592
/>
593593
) );
594594

595-
const resetContentAttributes = () => {
596-
setAttributes( {
597-
alt: undefined,
598-
} );
599-
};
600-
601595
const resetSettings = () => {
602596
setAttributes( {
603597
lightbox: undefined,
@@ -783,13 +777,14 @@ export default function Image( {
783777
<InspectorControls group="content">
784778
<ToolsPanel
785779
label={ __( 'Media' ) }
786-
resetAll={ resetContentAttributes }
780+
resetAll={ () => onSelectImage( undefined ) }
787781
dropdownMenuProps={ dropdownMenuProps }
788782
>
789783
{ isSingleSelected && ! lockUrlControls && (
790784
<ToolsPanelItem
791785
label={ __( 'Image' ) }
792786
hasValue={ () => !! url }
787+
onDeselect={ () => onSelectImage( undefined ) }
793788
isShownByDefault
794789
>
795790
<MediaControl

0 commit comments

Comments
 (0)