Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove duplicate code
  • Loading branch information
talldan committed Apr 18, 2023
commit 8671b30ea3d6e5fd5e0908818118fa739c9f89fe
21 changes: 1 addition & 20 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,25 +561,6 @@ export default function Image( {
// becomes available.
const maxWidthBuffer = maxWidth * 2.5;

const imgInner = (
<img
src={ temporaryURL || url }
alt={ defaultedAlt }
onError={ () => onImageError() }
onLoad={ ( event ) => {
setLoadedNaturalSize( {
loadedNaturalWidth: event.target?.naturalWidth,
loadedNaturalHeight: event.target?.naturalHeight,
} );
} }
ref={ imageRef }
className={ borderProps.className }
style={ {
...borderProps.style,
} }
/>
);

img = (
<ResizableAlignmentControls
allowedAlignments={ [ 'none', 'wide', 'full' ] }
Expand Down Expand Up @@ -609,7 +590,7 @@ export default function Image( {
height: height && ! hasCustomBorder ? height : 'auto',
} }
>
{ imgInner }
{ img }
</ResizableAlignmentControls>
);
}
Expand Down