material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Edit does not update table

Open gabbottron opened this issue 6 years ago • 6 comments

Describe the bug Edit does not actually show changes in the table. It doesn't even work on the example page: https://material-table.com/#/docs/features/editable

Attempt to edit a field and hit the check button and the table just reverts to original state. The behavior is the same in my example app despite the state changing.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://material-table.com/#/docs/features/editable
  2. Edit one of the fields
  3. Hit check box
  4. Observe table does not update.

Expected behavior Table should update based on new data.

Is anyone else seeing this?

gabbottron avatar Dec 19 '19 22:12 gabbottron

https://github.com/mbrn/material-table/issues/1417

guyla avatar Dec 20 '19 11:12 guyla

Describe the bug Edit does not actually show changes in the table. It doesn't even work on the example page: https://material-table.com/#/docs/features/editable

Attempt to edit a field and hit the check button and the table just reverts to original state. The behavior is the same in my example app despite the state changing.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://material-table.com/#/docs/features/editable
  2. Edit one of the fields
  3. Hit check box
  4. Observe table does not update.

Expected behavior Table should update based on new data.

Is anyone else seeing this?

yeah, it doesn't work. Array.from(data) didn't work as well for me.

rizabek-mukanov avatar Dec 23 '19 02:12 rizabek-mukanov

Describe the bug Edit does not actually show changes in the table. It doesn't even work on the example page: https://material-table.com/#/docs/features/editable

Attempt to edit a field and hit the check button and the table just reverts to original state. The behavior is the same in my example app despite the state changing.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://material-table.com/#/docs/features/editable
  2. Edit one of the fields
  3. Hit check box
  4. Observe table does not update.

Expected behavior Table should update based on new data.

Is anyone else seeing this?

It works with functional components with hook but it is not working with class based component.

BhushanDangore avatar Dec 25 '19 10:12 BhushanDangore

Describe the bug Edit does not actually show changes in the table. It doesn't even work on the example page: https://material-table.com/#/docs/features/editable Attempt to edit a field and hit the check button and the table just reverts to original state. The behavior is the same in my example app despite the state changing. To Reproduce Steps to reproduce the behavior:

  1. Go to https://material-table.com/#/docs/features/editable
  2. Edit one of the fields
  3. Hit check box
  4. Observe table does not update.

Expected behavior Table should update based on new data. Is anyone else seeing this?

It works with functional components with hook but it is not working with class based component.

  • i can confirm this. @gabbottron, hope this will be hopeful. I set my data like: data={Array.from(tableData)} and onRowUpdate onRowUpdate: (newData, oldData) => new Promise(resolve => { setTimeout(() => { resolve(); const { sampleID, ...rest } = newData; const data = Array.from(tableData); data[data.indexOf(oldData)] = newData; setTableData(() => data); resolve(); }, 700); }),

tengemakers avatar Dec 25 '19 10:12 tengemakers

https://github.com/mbrn/material-table/issues/1413#issuecomment-572858590

AugustoCalaca avatar Jan 10 '20 03:01 AugustoCalaca

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

stale[bot] avatar Jun 30 '20 23:06 stale[bot]