-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[DataGrid] Fix last column border inconsistency #4224
Conversation
These are the results for the performance tests:
|
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.
Shouldn't we fix disableExtendRowFullWidth
too? Reading its description seems that we're supporting partially it = only removing the last border. If the description is correct, disableExtendRowFullWidth=false
should behave like if the last column had flex=1
.
mui-x/packages/grid/x-data-grid/src/models/props/DataGridProps.ts
Lines 163 to 166 in c746e61
* If `true`, rows will not be extended to fill the full width of the grid container. | |
* @default false | |
*/ | |
disableExtendRowFullWidth: boolean; |
Currently, it gives the impression that the row is extending the full width, but once the cell is clicked I see its true width.
Changing the way disableExtendRowFullWidth
works can be a breaking change, it depends on how we see its behavior.
const showRightBorder = !isLastColumn | ||
? rootProps.showCellRightBorder | ||
: !removeLastBorderRight && rootProps.disableExtendRowFullWidth; | ||
const showRightBorder = rootProps.showCellRightBorder; |
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.
827cbe8
to
e1b7350
Compare
@m4theushw I reverted my changes, to only correct the About In fact their is multiple level of implementations:
But this sounds like a low priority feature. As soon as the grid overflow in x-axis, it does not have any impact and I believe it's the most frequent case |
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.
We can continue the discussion for deeper changes later on
But this one-liner seems to fix an error so I would be in favor of moving forward
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.
About disableExtendRowFullWidth=false I gave it a try, but I did not succeed, because I tried to do the modifications in components rendering, style. But they are overridden when resizing.
In v6 we can revisit this prop and make it work correctly. What about adding it to #3287?
@m4theushw I added it |
Fix #4200
Why headers and row behave differently
The inconsistency between header and rows comes from the computation of the last column, which should be modified as follow
It appears in the issue example because one of the columns was hidden
Proposed solution
In #2444 the consistency has been added, and the chosen solution was to remove borders for the last column. I propose to do the opposite for two reasons:
showColumnRightBorder=true
this handlers became invisible, and so we need a border to know exactly where doe the last column ends