Skip to content

Commit

Permalink
fix #1652
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Sep 30, 2017
1 parent c71aef8 commit 88571ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,7 @@ BootstrapTable.propTypes = {
cellEdit: PropTypes.shape({
mode: PropTypes.string,
blurToSave: PropTypes.bool,
blurToEscape: PropTypes.bool,
beforeSaveCell: PropTypes.func,
afterSaveCell: PropTypes.func,
nonEditableRows: PropTypes.func
Expand Down Expand Up @@ -1703,6 +1704,7 @@ BootstrapTable.defaultProps = {
cellEdit: {
mode: Const.CELL_EDIT_NONE,
blurToSave: false,
blurToEscape: false,
beforeSaveCell: undefined,
afterSaveCell: undefined,
nonEditableRows: undefined
Expand Down
1 change: 1 addition & 0 deletions src/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class TableBody extends Component {
format={ column.format ? format : false }
key={ i }
blurToSave={ cellEdit.blurToSave }
blurToEscape={ cellEdit.blurToEscape }
onTab={ this.handleEditCell }
rowIndex={ r }
colIndex={ i }
Expand Down
3 changes: 3 additions & 0 deletions src/TableEditColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class TableEditColumn extends Component {
}
this.props.completeEdit(
value, this.props.rowIndex, this.props.colIndex);
} else if (this.props.blurToEscape) {
this.props.completeEdit(null, this.props.rowIndex, this.props.colIndex);
}
}

Expand Down Expand Up @@ -266,6 +268,7 @@ TableEditColumn.propTypes = {
rowIndex: PropTypes.number,
colIndex: PropTypes.number,
blurToSave: PropTypes.bool,
blurToEscape: PropTypes.bool,
editable: PropTypes.oneOfType([ PropTypes.bool, PropTypes.object ]),
format: PropTypes.oneOfType([ PropTypes.bool, PropTypes.func ]),
row: PropTypes.any,
Expand Down

0 comments on commit 88571ac

Please sign in to comment.