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

Error while typing on input on new row, if onRowDataChange

Open sindhujaGovindarajan opened this issue 6 years ago • 30 comments

Guidelines

  • Please include a demo of the issue/behavior/question you have

  • Please try to be as detailed as possible

  • You may fork one of the following starter templates if you would like:

Describe the bug While typing on any one of the inputs on a new row (that displays on click of add icon), if the editComponent input includes onRowDataChange property, then TypeError: _this2.props.onBulkEditRowChanged is not a function is thrown. This is because onBulkEditRowChanged function is not defined in a new row props.

To Reproduce Steps to reproduce the behavior:

  1. Create a MaterialTable component
  2. Add editComponent for a column
  3. On column with editComponent, add onRowDataChange action
  4. On the browser, click on add row
  5. On the new row created, start typing on the column with onRowDataChange
  6. See error

Expected behavior Normal behaviour as the other rows while updation, but in the context of new addition.

Screenshots image image image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: chrome
  • Version 84.0.4147.89 (Official Build) (64-bit)

sindhujaGovindarajan avatar Aug 03 '20 18:08 sindhujaGovindarajan

+1 - It does not seem to be working on the example page as well. https://material-table.com/#/docs/features/editable

Also, this seems to be an issue with the latest version of material-table (1.68). Seems to be working fine with 1.67.1.

piyushsmantri avatar Aug 03 '20 22:08 piyushsmantri

Have similar issue. Downgrade to previous version 1.67.1

1ur11 avatar Aug 04 '20 13:08 1ur11

Yes. The downgrade worked for me too. Bug on version 1.68.0 release.

On Tue, 4 Aug 2020 at 6:39 PM, Yuri Kravcenko [email protected] wrote:

Have similar issue. Downgrade to previous version 1.67.1

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mbrn/material-table/issues/2269#issuecomment-668586212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFRXJS6W6LHGN3ZGBIWKTS3R7ACBPANCNFSM4PTTQJMA .

-- Regards, Sindhuja Govindarajan. Chennai, TN, India.

sindhujaGovindarajan avatar Aug 04 '20 13:08 sindhujaGovindarajan

Got the same issue. Downgrade to 1.67.1 works

alokCrewFoundry avatar Aug 04 '20 21:08 alokCrewFoundry

I currently use version 1.57.2 and the same thing happens

javipart avatar Aug 04 '20 22:08 javipart

Started to experience that few minutes ago after editing the table once it keeps throw this exception.

eyalgo-investing avatar Aug 05 '20 08:08 eyalgo-investing

Got the same issue. Downgrade to 1.67.1 works

Same.

tinesolbakken avatar Aug 05 '20 10:08 tinesolbakken

Same issue, and downgrading to 1.67 I am having a bunch of warnings...

flora8984461 avatar Aug 05 '20 16:08 flora8984461

This is simply caused by passing this to the base input field. This should be removed from the spreaded props somewhere. {...props}. Can someone open a PR to extract that?

DominikEngel avatar Aug 05 '20 22:08 DominikEngel

Same issue here

ghost avatar Aug 06 '20 04:08 ghost

It works when I downgraded to 1.67.1. Just be careful to remove the ^ in your package.json. -> You should have: "material-table": "1.67.1", and not "material-table": "^1.67.1", (it might install 1.68, the buggued version)

iElsha avatar Aug 06 '20 13:08 iElsha

Yes, could you please fix this on 1.68.0? Because on 1.67.1, there was another error, so I had to bump up to 1.68

orhanhub avatar Aug 08 '20 22:08 orhanhub

Its not a bug but it was renamed to onBulkUpdate. So you need to use this.

Domino987 avatar Aug 09 '20 18:08 Domino987

The issue is still there with onRowAdd, examples (Custom Edit Component Example) given here https://material-table.com/#/docs/features/editable are not working either. Error: TypeError: e.props.onBulkEditRowChanged is not a function

Downgraded to "material-table": "^1.67.1"

ankitoye avatar Aug 10 '20 07:08 ankitoye

The basic add feature itself doesn’t work on the material-table doc examples.

This is not just about a function rename as you say.

On Mon, 10 Aug 2020 at 12:11 AM, Domino987 [email protected] wrote:

Its not a bug but it was renamed to onBulkEditRowChanged. So you need to use this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mbrn/material-table/issues/2269#issuecomment-671086946, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFRXJS7S6HXJLP433A6SCPDR73UWVANCNFSM4PTTQJMA .

-- Regards, Sindhuja Govindarajan. Chennai, TN, India.

sindhujaGovindarajan avatar Aug 10 '20 10:08 sindhujaGovindarajan

@Domino987 ok, let's try adding a column in your examples page, when u start type text to column, table is crashed https://material-table.com/#/docs/features/editable image

petr-like avatar Aug 10 '20 14:08 petr-like

@Domino987 ok, let's try adding a column in your examples page, when u start type text to column, table is crashed https://material-table.com/#/docs/features/editable image

@petr-like Literally right now encountered this issue, as the other dev friends said, downgrade to 1.67.1 and make sure in your package.json looks something like this:

"material-table": "1.67.1" not "material-table": "^1.67.1"

It worked for me instantly...

ditherized avatar Aug 10 '20 14:08 ditherized

@Domino987 This is a bug indeed, it shouldn't be closed. Have a look for yourself at https://material-table.com/#/docs/features/editable:

  1. Open the console
  2. Expand "Editable example"
  3. Click on the add button
  4. Try writing anything in the "name" field. The UI becomes broken immediately and the following error appears:
TypeError: e.props.onBulkEditRowChanged is not a function. (In 'e.props.onBulkEditRowChanged(e.props.data,n)', 'e.props.onBulkEditRowChanged' is undefined)

gtupak avatar Aug 10 '20 20:08 gtupak

I am having the same issue while running the codesandbox.io material-table example referenced in material-ui.com. Easily reproducible by simply clicking on the edit in sandbox example and attempting to add a new row. The error is thrown when typing in one of the input fields of the newly added row.

danadaimy avatar Aug 11 '20 01:08 danadaimy

+1

sergi-io avatar Aug 11 '20 10:08 sergi-io