Skip to content

Commit

Permalink
Image Block: Hide controls while in upload state (#30891)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Apr 22, 2021
1 parent de77d3e commit 22bde90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,9 @@ export default function Image( {
isEditing={ isEditingImage }
onFinishEditing={ () => setIsEditingImage( false ) }
>
{ controls }
{ /* Hide controls during upload to avoid component remount,
which causes duplicated image upload. */ }
{ ! temporaryURL && controls }
{ img }
{ ( ! RichText.isEmpty( caption ) || isSelected ) && (
<RichText
Expand Down

0 comments on commit 22bde90

Please sign in to comment.