parent
c3e6c83815
commit
3e1e7b2ee6
|
@ -21,20 +21,7 @@ const factory = (Checkbox) => {
|
|||
};
|
||||
|
||||
handleInputChange = (index, key, type, event) => {
|
||||
let value;
|
||||
switch (type) {
|
||||
case 'checkbox':
|
||||
value = event.target.checked;
|
||||
break;
|
||||
// Handle contentEditable
|
||||
case 'text':
|
||||
value = event.target.textContent;
|
||||
break;
|
||||
default:
|
||||
value = event.target.value;
|
||||
break;
|
||||
}
|
||||
|
||||
const value = type === 'checkbox' ? event.target.checked : event.target.value;
|
||||
const onChange = this.props.model[key].onChange || this.props.onChange;
|
||||
onChange(index, key, value);
|
||||
};
|
||||
|
|
|
@ -43,7 +43,7 @@ var factory = function factory(Checkbox) {
|
|||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(TableRow)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.handleInputChange = function (index, key, type, event) {
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TableRow.__proto__ || Object.getPrototypeOf(TableRow)).call.apply(_ref, [this].concat(args))), _this), _this.handleInputChange = function (index, key, type, event) {
|
||||
var value = type === 'checkbox' ? event.target.checked : event.target.value;
|
||||
var onChange = _this.props.model[key].onChange || _this.props.onChange;
|
||||
onChange(index, key, value);
|
||||
|
|
Loading…
Reference in New Issue