@@ -94,7 +94,7 @@ class MTableEditCell extends React.Component {
94
94
this . props . onCellEditFinished ( this . props . rowData , this . props . columnDef ) ;
95
95
} ;
96
96
97
- renderActions ( isValid ) {
97
+ renderActions ( ) {
98
98
if ( this . state . isLoading ) {
99
99
return (
100
100
< div style = { { display : 'flex' , justifyContent : 'center' , width : 60 } } >
@@ -108,7 +108,7 @@ class MTableEditCell extends React.Component {
108
108
icon : this . props . icons . Check ,
109
109
tooltip : this . props . localization . saveTooltip ,
110
110
onClick : this . onApprove ,
111
- disabled : ! this . state . isLoading || ! isValid
111
+ disabled : ! this . state . isLoading || ! this . state . errorState . isValid
112
112
} ,
113
113
{
114
114
icon : this . props . icons . Clear ,
@@ -128,23 +128,17 @@ class MTableEditCell extends React.Component {
128
128
}
129
129
130
130
handleChange ( value ) {
131
- const errorState = this . props . columnDef . validate ( {
132
- [ this . props . columnDef . field ] : value
133
- } ) ;
131
+ const errorState = validateInput ( this . props . columnDef , value ) ;
134
132
this . setState ( { errorState, value } ) ;
135
133
}
136
134
137
135
render ( ) {
138
- const error = validateInput ( this . props . columnDef , this . state . value ) ;
139
- console . log ( error ) ;
140
136
return (
141
137
< TableCell size = { this . props . size } style = { this . getStyle ( ) } padding = "none" >
142
138
< div style = { { display : 'flex' , alignItems : 'center' } } >
143
139
< div style = { { flex : 1 , marginRight : 4 } } >
144
140
< this . props . components . EditField
145
141
columnDef = { this . props . columnDef }
146
- error = { ! error . isValid }
147
- helperText = { error . helperText }
148
142
value = { this . state . value }
149
143
error = { ! this . state . errorState . isValid }
150
144
helperText = { this . state . errorState . helperText }
@@ -155,7 +149,7 @@ class MTableEditCell extends React.Component {
155
149
autoFocus
156
150
/>
157
151
</ div >
158
- { this . renderActions ( error . isValid ) }
152
+ { this . renderActions ( ) }
159
153
</ div >
160
154
</ TableCell >
161
155
) ;
0 commit comments