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 {
24
24
}
25
25
26
26
getNumericInputClassName ( value ) {
27
- return isNumeric ( value )
27
+ return isNumeric ( value ) || value === ''
28
28
? `numeric-input__number ${ this . props . editableClassName ? this . props . editableClassName : '' } `
29
29
: `numeric-input__number--error ${
30
30
this . props . editableClassName ? this . props . editableClassName : ''
@@ -68,6 +68,14 @@ export default class NumericInput extends Component {
68
68
const { max, min, integerOnly} = this . props ;
69
69
let updatedValue = newValue ;
70
70
71
+ if ( updatedValue === '' ) {
72
+ this . setState ( {
73
+ value : this . props . value ,
74
+ numericInputClassName : this . getNumericInputClassName ( this . props . value ) ,
75
+ } ) ;
76
+ return ;
77
+ }
78
+
71
79
// When the user blurs on non-numeric data reset the component
72
80
// to the last known good value (this.props.value).
73
81
if ( ! isNumeric ( updatedValue ) ) {
You can’t perform that action at this time.
0 commit comments