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

parentChildData inside Dialog exceeds maximum call stack

Open Androsv96 opened this issue 6 years ago • 2 comments

Describe the bug Using material-table inside Dialog and providing it parentChildData causes "Maximum call stack size exceeded".

To Reproduce I have created a sandbox test, visit this: https://codesandbox.io/s/dreamy-driscoll-r2xwg

Expected behavior Render data relating parent and child.

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Browser: Opera
  • Version: 66.0.3515.103

Extra: I tried using disableEnforceFocus in Dialog but it does not solves the issue either.

Androsv96 avatar Feb 21 '20 20:02 Androsv96

The problem is not in the dialog, it's in your data. You're missing an Id there

const columns = [
  { title: "Provider", field: "providerName" },
  { title: "Product", field: "product" }
];
const data = [
  { id: 1, providerName: "My name" },
  { id: 2, parentId: 1, product: "Product" }
];

jonasanx avatar Feb 21 '20 21:02 jonasanx

You are completelly rigth. The issue is that all data rows must have id sequence. Thank you for your quickly response.

Androsv96 avatar Feb 21 '20 22:02 Androsv96