diff --git a/src/material-table.js b/src/material-table.js index 7e936e09..7d14c3e8 100644 --- a/src/material-table.js +++ b/src/material-table.js @@ -693,6 +693,8 @@ export default class MaterialTable extends React.Component { this.dataManager.changeRowEditing(rowData); this.setState(this.dataManager.getRenderState()); } else if (mode === 'delete') { + this.props.editable.onRowDeleteCancelled && + this.props.editable.onRowDeleteCancelled(rowData); this.dataManager.changeRowEditing(rowData); this.setState(this.dataManager.getRenderState()); } diff --git a/src/prop-types.js b/src/prop-types.js index 19f10b47..df18fda2 100644 --- a/src/prop-types.js +++ b/src/prop-types.js @@ -203,6 +203,7 @@ export const propTypes = { onRowUpdate: PropTypes.func, onRowDelete: PropTypes.func, onRowAddCancelled: PropTypes.func, + onRowDeleteCancelled: PropTypes.func, onRowUpdateCancelled: PropTypes.func, isEditHidden: PropTypes.func, isDeleteHidden: PropTypes.func diff --git a/types/index.d.ts b/types/index.d.ts index 6a7a57fc..8a67b7a0 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -51,6 +51,7 @@ export interface MaterialTableProps { editTooltip?: (rowData: RowData) => string; deleteTooltip?: (rowData: RowData) => string; onRowAddCancelled?: (rowData: RowData) => void; + onRowDeleteCancelled?: (rowData: RowData) => void; onRowUpdateCancelled?: (rowData: RowData) => void; isEditHidden?: (rowData: RowData) => boolean; isDeleteHidden?: (rowData: RowData) => boolean;