From 7bd2a3a423f975c269c12071ae5ac0c0eee23c22 Mon Sep 17 00:00:00 2001 From: r-a-y Date: Thu, 9 Apr 2020 16:11:45 -0700 Subject: [PATCH] Gutenberg: Fix issues with validating width and height values as numbers. See #13. --- block.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block.js b/block.js index 50ded70..6e98602 100644 --- a/block.js +++ b/block.js @@ -389,17 +389,17 @@ value: attr.width, onChange: function( newVal ) { props.setAttributes({ - width: newVal * 1 + width: newVal.replace(/\D+/,'') * 1 }); }, } ), el( wp.components.TextControl, { className: 'block-library-image__dimensions__height components-base-control block-editor-image-size-control__height', label: i18n.__( 'Height' ), - value: attr.height , + value: attr.height, onChange: function( newVal ) { props.setAttributes({ - height: newVal * 1 + height: newVal.replace(/\D+/,'') * 1 }); }, } ),