-
-
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
[DataGridPremium] Fix excel export causing column with wrong width #13191
Conversation
Deploy preview: https://deploy-preview-13191--material-ui-x.netlify.app/ |
createValueOptionsSheetIfNeeded(valueOptionsData, valueOptionsSheetName, workbook); | ||
|
||
rowIds.forEach((id) => { | ||
const serializedRow = serializeRow(id, columns, api, valueOptionsData, options); | ||
const serializedRow = serializeRow(id, columns, apiRef, valueOptionsData, options); |
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.
Confirm if this can also mutate the colspan info.
@@ -85,7 +85,7 @@ const createScrollCache = ( | |||
}); | |||
type ScrollCache = ReturnType<typeof createScrollCache>; | |||
|
|||
const isJSDOM = typeof window !== 'undefined' ? /jsdom/.test(window.navigator.userAgent) : false; | |||
const isJSDOM = typeof navigator !== 'undefined' ? /jsdom/.test(navigator.userAgent) : false; |
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.
This change caused the tests in JSDOM to fail.
Turns out navigator.userAgent !== window.navigator.userAgent
:
I'll submit a PR to the core repo to fix this inconsistency.
What was the reason for this change anyway? We should revert it for now
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.
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.
It was failing in devmode inside an excel export worker, something being undefined.
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.
Closes #12641
Before: https://codesandbox.io/p/sandbox/silly-pare-vfzsdq (this fails in CSB, not sure if excel export is testable there?)
After: