Skip to content

Commit

Permalink
Simplify setting value of number control
Browse files Browse the repository at this point in the history
  • Loading branch information
donnapep committed May 3, 2021
1 parent ae3e8cb commit c433590
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions assets/blocks/editor-components/number-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ const NumberControl = ( {
...props
} ) => {
const setValue = ( e ) => {
if ( e.target.value ) {
onChange( parseInt( e.target.value, 10 ) );
} else {
onChange( props.min ? props.min : 0 );
}
onChange( e.target.value || props.min || 0 );
};

return (
Expand Down

0 comments on commit c433590

Please sign in to comment.