-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RangeError Maximum call stack size exceeded #9550
Comments
You are supposed to have a unique value in the |
@MBilalShafi Although there is no known cause, the component has occasionally crashed when the backend delivered duplicate field data. |
It also happen to us on version @mui/[email protected] We don't have duplicate |
|
@fingeromer Could you provide a live minimal reproduction on |
@SAMBIT20 It goes into an infinite loop for flex (same field name) because we store the values for the columns in a lookup based on diff --git a/packages/grid/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts b/packages/grid/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts
index 2b1f02e94..c714d17b8 100644
--- a/packages/grid/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts
+++ b/packages/grid/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts
@@ -42,6 +42,7 @@ export function computeFlexColumnsWidth({
maxWidth?: number;
}[];
}) {
+ const uniqueFlexColumns = new Set<GridColDef['field']>(flexColumns.map((col) => col.field));
const flexColumnsLookup: {
all: Record<
GridColDef['field'],
@@ -68,7 +69,7 @@ export function computeFlexColumnsWidth({
// Step 5 of https://drafts.csswg.org/css-flexbox-1/#resolve-flexible-lengths
function loopOverFlexItems() {
// 5a: If all the flex items on the line are frozen, free space has been distributed.
- if (flexColumnsLookup.frozenFields.length === flexColumns.length) {
+ if (flexColumnsLookup.frozenFields.length === uniqueFlexColumns.size) {
return;
} If the intention though is to support proper flex positioning for such columns (those with the same field value), we might need to change the data structure used in @cherniavskii Any opinion on this? |
@MBilalShafi Thanks for looking into it!
I don't think we should, a lot of things won't work with duplicated fields anyway 🙂 |
Untitled_.Jul.3.2023.8_22.PM.webmhttps://codesandbox.io/s/recursing-cloud-qwvfdz |
Thanks, @fingeromer! const containerWidth = 1582;
const colNumber = 6;
const colWidth = containerWidth / colNumber; // 263.6666666666667
colWidth * 6 // 1582
colWidth * 5 + colWidth // 1582.0000000000002 It's a regression caused by #9516 |
@seemX17 Can you open an issue with a reproduction example? Thanks! |
@cherniavskii As I have mentioned in the above comment the issue was resolved with the latest version. Have added the screenshot for the developer reference but If I come across the same bug again will create a new issue with an example. Thanks! |
@seemX17 Sorry, somehow I misunderstood your comment and thought that you experienced this issue with the latest version 😅 |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example:
codesandbox
Steps:
Current behavior 😯
Expected behavior 🤔
No response
Context 🔦
No response
Your environment 🌎
npx @mui/envinfo
Order ID or Support key 💳 (optional)
62159
The text was updated successfully, but these errors were encountered: