From 66c97bd0cd2903986e8d74b20e8772208266f871 Mon Sep 17 00:00:00 2001 From: nfmohit Date: Sun, 12 Aug 2018 22:50:20 +0600 Subject: [PATCH] Set default values of the width and height input fields according to the actual image dimensions --- packages/block-library/src/image/edit.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/image/edit.js b/packages/block-library/src/image/edit.js index 2a3a2b9530a36f..c3e136cf6b705b 100644 --- a/packages/block-library/src/image/edit.js +++ b/packages/block-library/src/image/edit.js @@ -474,8 +474,7 @@ 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 } /> @@ -483,8 +482,7 @@ class ImageEdit extends Component { 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 } />