Skip to content

Commit

Permalink
Set default values of the width and height input fields according to …
Browse files Browse the repository at this point in the history
…the actual image dimensions (#7687)
  • Loading branch information
Nahid F. Mohit authored and gziolo committed Feb 4, 2019
1 parent dc2c1f7 commit 0f82867
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/block-library/src/image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,17 +474,15 @@ class ImageEdit extends Component {
type="number"
className="block-library-image__dimensions__width"
label={ __( 'Width' ) }
value={ width !== undefined ? width : '' }
placeholder={ imageWidth }
value={ width !== undefined ? width : imageWidth }
min={ 1 }
onChange={ this.updateWidth }
/>
<TextControl
type="number"
className="block-library-image__dimensions__height"
label={ __( 'Height' ) }
value={ height !== undefined ? height : '' }
placeholder={ imageHeight }
value={ height !== undefined ? height : imageHeight }
min={ 1 }
onChange={ this.updateHeight }
/>
Expand Down

0 comments on commit 0f82867

Please sign in to comment.