gregnb / gregnb/mui-datatables
onRowsDelete not functioning properly as an async function
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 906
- PR merge metrics
- No merged PRs in 30d
Description
When handling onRowsDelete and returning false in an async function, the selected row still gets deleted even though it shouldn't
## Expected Behavior
Returning false in an async function should prevent deletion of the selected row as the documentation stated
## Current Behavior
Returning false in an async function still deletes the selected row anyway triggering the re-render state of the table.
## Steps to Reproduce (for bugs)
handleDelete = async (rowsDeleted) => {
return false;
};
render() {
return(
);
};
Will result in MUIDataTable deleting the selected row even though the return value is false.
When the handleDelete is not an async function, it works as expected.
Online example is [here](https://codesandbox.io/s/mui-datatable-onrowsdelete-j5gtm)
## Your Environment
| Tech | Version |
|--------------|---------|
| Material-UI-Core | ^4.9.9 |
| Material-UI-Icon | ^4.9.1 |
| MUI-datatables | ^2.14.0 |
| React | ^16.12.0 |
| Browser | Chrome Version 81.0.4044.129 (Official Build) (64-bit) |
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.