Skip to content

Commit 2e0eca5

Browse files
committed
close #472
1 parent 864cf9e commit 2e0eca5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/TableEditColumn.js

+8
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,18 @@ class TableEditColumn extends Component {
2525
} else if (e.keyCode === 27) {
2626
this.props.completeEdit(
2727
null, this.props.rowIndex, this.props.colIndex);
28+
} else if (e.type === 'click') { // textarea click save button
29+
const value = e.target.parentElement.firstChild.value;
30+
if (!this.validator(value)) {
31+
return;
32+
}
33+
this.props.completeEdit(
34+
value, this.props.rowIndex, this.props.colIndex);
2835
}
2936
}
3037

3138
handleBlur = e => {
39+
e.stopPropagation();
3240
if (this.props.blurToSave) {
3341
const value = e.currentTarget.type === 'checkbox' ?
3442
this._getCheckBoxValue(e) : e.currentTarget.value;

0 commit comments

Comments
 (0)