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

isEditable conditional is broken in version 1.54.1

Open bilix opened this issue 7 years ago • 11 comments

Describe the bug isEditable is not working in version 1.54.1. It works fine in version 1.54.0. If the condition is set to false, you can edit the row anyway.

To Reproduce

editable={{               
    isEditable: rowData => false,
    onRowUpdate: (newData, oldData) =>
        new Promise((resolve, reject) => {
            setTimeout(() => {
                {
                      /* const data = this.state.data;
                      const index = data.indexOf(oldData);
                      data[index] = newData;                
                      this.setState({ data }, () => resolve()); */
                 }
                 resolve();
                 }, 1000);
              }),
         }}

Expected behavior The edit action button is disabled

bilix avatar Nov 12 '19 10:11 bilix

(This repo needs some unit tests)

ogenodisho avatar Nov 17 '19 22:11 ogenodisho

I confirm. not only isEditable, but also isDeletable too

georgehazan avatar Nov 21 '19 08:11 georgehazan

I can confirm it also

thuryn avatar Nov 26 '19 13:11 thuryn

this issue is still in version 1.54.2

noneall avatar Dec 24 '19 21:12 noneall

I can confirm it also, isEditable is not working yet... Please confirm @benrawn commit

jfocco-IUGO avatar Jan 02 '20 15:01 jfocco-IUGO

Also running into this issue

thelazydogsback avatar Jan 05 '20 03:01 thelazydogsback

Also experiencing this. I used patch-package module to apply the change for my project. Thanks @benrawn for the fix.

evblurbs avatar Jan 21 '20 08:01 evblurbs

I am still experiencing this issue in 1.57.2. Can anybody else confirm?

william13murphy avatar Feb 13 '20 21:02 william13murphy

@william13murphy i do not confirm. Just updated my version to 1.57.2 and its seems to be working

          editable={{
            isEditable: rowData => selectedSubst.includes(rowData.id),
            onRowUpdate: (newData, oldData) => {},
          }}

LuisPinaSoares avatar Feb 18 '20 09:02 LuisPinaSoares

@LuisPinaSoares Thank you for your response. isEditable is working as intended!!

Thank you package managers/contributors for a wonderful library.

william13murphy avatar Feb 18 '20 14:02 william13murphy

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 Jul 05 '20 22:07 stale[bot]