Skip to content

Commit

Permalink
Add onRowDeleteCancelled prop (#822)
Browse files Browse the repository at this point in the history
add "missing" onRowDeleteCancelled, to match onRowAddCancelled and onRowUpdateCancelled.
  • Loading branch information
KippWade authored Jan 31, 2024
1 parent 9bd189a commit a80838c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/material-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
1 change: 1 addition & 0 deletions src/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface MaterialTableProps<RowData extends object> {
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;
Expand Down

0 comments on commit a80838c

Please sign in to comment.