Skip to content

Commit

Permalink
Gutenberg: Fix issues with validating width and height values as numb…
Browse files Browse the repository at this point in the history
…ers.

See #13.
  • Loading branch information
r-a-y committed Apr 9, 2020
1 parent 67ed6a3 commit 7bd2a3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions block.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
},
} ),
Expand Down

0 comments on commit 7bd2a3a

Please sign in to comment.