-
-
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] Remove disableExtendRowFullWidth
prop
#7373
Merged
MBilalShafi
merged 8 commits into
mui:next
from
MBilalShafi:remove-disableExtendRowFullWidth-prop
Jan 13, 2023
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5bf4f9e
[DataGrid] Remove 'disableExtendRowFullWidth' prop
MBilalShafi 8401bbc
Fix build
MBilalShafi 39f7f91
lint
MBilalShafi 0d2a242
Update migration guide
MBilalShafi de99803
Merge 'next' into 'remove-disableExtendRowFullWidth-prop'
MBilalShafi a36aeac
prettier?
MBilalShafi bd95866
Merge branch 'next' into remove-disableExtendRowFullWidth-prop
MBilalShafi 8171bb0
lint
MBilalShafi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
docs/data/data-grid/column-spanning/ColumnSpanningFunction.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<DataGrid | ||
autoHeight | ||
disableExtendRowFullWidth | ||
disableColumnFilter | ||
disableRowSelectionOnClick | ||
hideFooter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ interface GridColumnGroupHeaderProps { | |
fields: string[]; | ||
colIndex: number; // TODO: use this prop to get accessible column group | ||
isLastColumn: boolean; | ||
extendRowFullWidth: boolean; | ||
depth: number; | ||
maxDepth: number; | ||
height: number; | ||
|
@@ -28,16 +27,14 @@ interface GridColumnGroupHeaderProps { | |
|
||
type OwnerState = { | ||
groupId: GridColumnGroupHeaderProps['groupId']; | ||
showRightBorder: boolean; | ||
showColumnBorder: boolean; | ||
isDragging: boolean; | ||
headerAlign?: GridAlignment; | ||
classes?: DataGridProcessedProps['classes']; | ||
}; | ||
|
||
const useUtilityClasses = (ownerState: OwnerState) => { | ||
const { classes, headerAlign, isDragging, showRightBorder, showColumnBorder, groupId } = | ||
ownerState; | ||
const { classes, headerAlign, isDragging, showColumnBorder, groupId } = ownerState; | ||
|
||
const slots = { | ||
root: [ | ||
|
@@ -46,8 +43,8 @@ const useUtilityClasses = (ownerState: OwnerState) => { | |
headerAlign === 'center' && 'columnHeader--alignCenter', | ||
headerAlign === 'right' && 'columnHeader--alignRight', | ||
isDragging && 'columnHeader--moving', | ||
showRightBorder && 'columnHeader--withRightBorder', | ||
showColumnBorder && 'columnHeader--showColumnBorder', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't combine these two as they apparently serve different purposes and might be segregated again in future |
||
showColumnBorder && 'columnHeader--withRightBorder', | ||
'withBorderColor', | ||
groupId === null ? 'columnHeader--emptyGroup' : 'columnHeader--filledGroup', | ||
], | ||
|
@@ -71,18 +68,13 @@ function GridColumnGroupHeader(props: GridColumnGroupHeaderProps) { | |
hasFocus, | ||
tabIndex, | ||
isLastColumn, | ||
extendRowFullWidth, | ||
} = props; | ||
|
||
const rootProps = useGridRootProps(); | ||
|
||
const headerCellRef = React.useRef<HTMLDivElement>(null); | ||
const apiRef = useGridApiContext(); | ||
const columnGroupsLookup = useGridSelector(apiRef, gridColumnGroupsLookupSelector); | ||
const { hasScrollX, hasScrollY } = apiRef.current.getRootDimensions() ?? { | ||
hasScrollX: false, | ||
hasScrollY: false, | ||
}; | ||
|
||
const group: Partial<GridColumnGroup> = groupId ? columnGroupsLookup[groupId] : {}; | ||
|
||
|
@@ -108,17 +100,11 @@ function GridColumnGroupHeader(props: GridColumnGroupHeaderProps) { | |
headerComponent = render(renderParams); | ||
} | ||
|
||
const removeLastBorderRight = isLastColumn && hasScrollX && !hasScrollY; | ||
const showRightBorder = !isLastColumn | ||
? rootProps.showColumnVerticalBorder | ||
: !removeLastBorderRight && !extendRowFullWidth; | ||
|
||
const showColumnBorder = rootProps.showColumnVerticalBorder; | ||
|
||
const ownerState = { | ||
...props, | ||
classes: rootProps.classes, | ||
showRightBorder, | ||
showColumnBorder, | ||
headerAlign, | ||
depth, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't know why this demo has not leveraged
disableExtendRowFullWidth
to remove the double border in the last column:Anyway, I think we could invest time later and remove the border of the last column if there's no empty space left. Even after adding
flex: 1
in a column, this double border will be there.