File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default class NumericInput extends Component {
2424 }
2525
2626 getNumericInputClassName ( value ) {
27- return isNumeric ( value )
27+ return isNumeric ( value ) || value === ''
2828 ? `numeric-input__number ${ this . props . editableClassName ? this . props . editableClassName : '' } `
2929 : `numeric-input__number--error ${
3030 this . props . editableClassName ? this . props . editableClassName : ''
@@ -68,6 +68,14 @@ export default class NumericInput extends Component {
6868 const { max, min, integerOnly} = this . props ;
6969 let updatedValue = newValue ;
7070
71+ if ( updatedValue === '' ) {
72+ this . setState ( {
73+ value : this . props . value ,
74+ numericInputClassName : this . getNumericInputClassName ( this . props . value ) ,
75+ } ) ;
76+ return ;
77+ }
78+
7179 // When the user blurs on non-numeric data reset the component
7280 // to the last known good value (this.props.value).
7381 if ( ! isNumeric ( updatedValue ) ) {
You can’t perform that action at this time.
0 commit comments