File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,10 @@ const NumeralInput = React.createClass({
90
90
} ;
91
91
} ,
92
92
getNumeralValue : function ( val ) {
93
- return numeral ( val ) . format ( this . props . fmt ) ;
93
+ if ( val ) {
94
+ return numeral ( val ) . format ( this . props . fmt ) ;
95
+ }
96
+ return '' ;
94
97
} ,
95
98
componentWillReceiveProps : function ( nextProps ) {
96
99
if ( this . props . value === nextProps . value ) {
@@ -102,7 +105,7 @@ const NumeralInput = React.createClass({
102
105
if ( ! reg . test ( val ) ) {
103
106
formatVal = this . getNumeralValue ( val ) ;
104
107
}
105
- formatVal = this . getNumeralValue ( val ) ;
108
+ // formatVal = this.getNumeralValue(val);
106
109
107
110
this . setState ( {
108
111
value : formatVal
@@ -136,7 +139,7 @@ const NumeralInput = React.createClass({
136
139
//parentNode onChange function
137
140
this . setState ( {
138
141
pos : pos ,
139
- value : val
142
+ value : val || ''
140
143
} , ( ) => {
141
144
if ( this . props . onChange ) {
142
145
this . props . onChange ( val ) ;
You can’t perform that action at this time.
0 commit comments