Skip to content

Commit df6da5f

Browse files
authored
fix (image block): if image is updated, the size may change (#3551)
1 parent f3c6632 commit df6da5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/block-components/image/edit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ const Controls = props => {
175175
newAttributes.imageWidth = ''
176176
newAttributes.imageWidthUnit = '%'
177177
// We need the width of the image block to compare
178-
if ( width < imageBlockWidth ) {
178+
if ( width && width < imageBlockWidth ) {
179179
newAttributes.imageWidth = width
180180
newAttributes.imageWidthUnit = 'px'
181181
}

0 commit comments

Comments
 (0)