-
-
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
[DataGrid] Fix overflow with dynamic row height #12683
Merged
Merged
Conversation
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
Deploy preview: https://deploy-preview-12683--material-ui-x.netlify.app/ Updated pages: |
michelengelen
approved these changes
Apr 11, 2024
cherniavskii
approved these changes
Apr 11, 2024
@@ -509,7 +509,8 @@ See the [Direct state access](/x/react-data-grid/state/#direct-selector-access) | |||
- You can now style a row's hover state using just `:hover` instead of `.Mui-hovered`. | |||
- The `.MuiDataGrid--pinnedColumns-(left\|right)` class for pinned columns has been removed. | |||
- The `.MuiDataGrid-cell--withRenderer` class has been removed. | |||
- The cell element isn't `display: flex` by default. You can add `display: 'flex'` on the column definition to restore the behavior. This also means cells aren't vertically centered by default anymore, so if you have dynamic row height, you might want to set the `display: 'flex'` for all non-dynamic columns. | |||
- The cell element isn't `display: flex` by default. You can add `display: 'flex'` on the column definition to restore the behavior. | |||
NOTE: If you're using **dynamic row height**, this also means cells aren't vertically centered by default anymore, you might want to set the `display: 'flex'` for all non-dynamic columns. This may also affect text-ellipsis, which you can restore by adding your own wrapper with `text-overflow: ellipsis;`. |
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.
Should we add a code snippet here?
{
display: "flex",
renderCell: ({ value }) => (
<div style={{ overflow: "hidden", textOverflow: "ellipsis" }}>
{value}
</div>
),
},
DungTiger
pushed a commit
to DungTiger/mui-x
that referenced
this pull request
Jul 23, 2024
thomasmoon
pushed a commit
to thomasmoon/mui-x
that referenced
this pull request
Sep 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #12682
Fix overflow behavior with dynamic row height. I'm not sure why the
overflow: initial
was added (probably by me) but I think this would be the correct behavior.Before: https://codesandbox.io/p/sandbox/aged-field-hjnfyv
After: https://codesandbox.io/p/sandbox/upbeat-liskov-c2j655