-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix an error that makes the width value string very long. #2441
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lines 87 and 88 are inconsistent
@cdruck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not work still the bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem is this:
OLD WRONG:
columnDef.tableData = {
columnOrder: index,
filterValue: columnDef.defaultFilter,
groupOrder: columnDef.defaultGroupOrder,
groupSort: columnDef.defaultGroupSort || 'asc',
width: typeof columnDef.width === 'number' ? `${columnDef.width}px` : columnDef.width,
initialWidth: typeof columnDef.width === 'number' ? `${columnDef.width}px` : columnDef.width,
additionalWidth: 0,
id: index,
...columnDef.tableData, // <------------------------------------ Mutable data overwrite the width
};
columnDef.tableData = {
...columnDef.tableData, // <------------------------------------ Now mutable data is overwrites by the next code
columnOrder: index,
filterValue: columnDef.defaultFilter,
groupOrder: columnDef.defaultGroupOrder,
groupSort: columnDef.defaultGroupSort || 'asc',
width: typeof columnDef.width === 'number' ? `${columnDef.width}px` : columnDef.width,
initialWidth: typeof columnDef.width === 'number' ? `${columnDef.width}px` : columnDef.width,
additionalWidth: 0,
id: index,
};
I applied this patch manually and it resolved the issue from what I could see. |
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. |
Related Issue
#2381
#2433 (not sure)
Description
columnDef.tableData.width
may be defined even ifcolumnDef.width
is undefined.Because the calculated
tableData.width
added to eachcolumn
object when the props updated or added.This function produces a string value with a previously calculated value each time it is called, so the length increases proportionally to the power of the number of columns with has undefined width.