Skip to content

Commit 4168db3

Browse files
committed
Merge branch 'jspaine-fix-double-validation' into v4.0.0-dev
2 parents b06fd5b + b460abc commit 4168db3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/TableEditColumn.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ class TableEditColumn extends Component {
2424

2525
handleKeyPress = e => {
2626
if (e.keyCode === 13 || e.keyCode === 9) {
27-
// Pressed ENTER
27+
// Pressed ENTER or TAB
2828
const value = e.currentTarget.type === 'checkbox' ?
2929
this._getCheckBoxValue(e) : e.currentTarget.value;
3030

31-
if (!this.validator(value)) {
31+
if ((e.keyCode === 9 && this.props.blurToSave) ||
32+
(!this.validator(value))) {
3233
return;
3334
}
35+
3436
if (e.keyCode === 13) {
3537
this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex);
3638
} else {

0 commit comments

Comments
 (0)