-
-
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
[DataGridPro] Keep bottom pinned row at the bottom #13313
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ef71664
fix: it
romgrk 937d64a
fix: overlay height
romgrk 710aa2d
fix: argos
romgrk 2dff02f
lint
romgrk b609a82
tests: fix warning
romgrk 18db7f7
test: add regression test
romgrk ac2db52
test: fix one
romgrk bda12ed
fix: test
romgrk e26c5ab
core: karma chrome bin
romgrk c378131
Merge branch 'master' into fix-bottom-pinned-row
romgrk da1a6ab
Merge branch 'master' into fix-bottom-pinned-row
romgrk 24a8285
test: fix
romgrk aa46d51
lint
romgrk 20080f7
test: fix
romgrk e1a1337
ci: run
romgrk 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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import * as React from 'react'; | ||
import { DataGridPro } from '@mui/x-data-grid-pro'; | ||
import { | ||
randomCity, | ||
randomEmail, | ||
randomId, | ||
randomInt, | ||
randomTraderName, | ||
randomUserName, | ||
} from '@mui/x-data-grid-generator'; | ||
|
||
const columns = [ | ||
{ field: 'name', headerName: 'Name', width: 150 }, | ||
{ field: 'city', headerName: 'City', width: 150 }, | ||
{ field: 'username', headerName: 'Username' }, | ||
{ field: 'email', headerName: 'Email', width: 200 }, | ||
{ field: 'age', type: 'number', headerName: 'Age' }, | ||
]; | ||
|
||
const rows = []; | ||
|
||
function getRow() { | ||
return { | ||
id: randomId(), | ||
name: randomTraderName(), | ||
city: randomCity(), | ||
username: randomUserName(), | ||
email: randomEmail(), | ||
age: randomInt(10, 80), | ||
}; | ||
} | ||
|
||
const pinnedRows = { | ||
top: [getRow()], | ||
bottom: [getRow()], | ||
}; | ||
|
||
export default function RowPinning() { | ||
return ( | ||
<div style={{ height: 500, width: '100%' }}> | ||
<DataGridPro columns={columns} rows={rows} pinnedRows={pinnedRows} /> | ||
</div> | ||
); | ||
} |
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 think this code was preventing this 0-height warning from running in some cases, so fixing it broke some tests all over the place that didn't have explicit dimensions on the grid container. I'll need to debug & update those tests before merging this PR. The test runner also doesn't seem to match the warning to which test it originated from precisely, so sometimes it marks one test as failed but the warning came from another test. As in if I run the test with
.only
it succeeds, but if I run the test suite as a whole it fails. Lots of fun ahead.